org.deduced.dynamic
Class DynamicPropertyMap

java.lang.Object
  extended by org.deduced.AbstractPropertyCollection<K,V>
      extended by org.deduced.PropertyMap<java.lang.Object,java.lang.Object>
          extended by org.deduced.dynamic.DynamicPropertyMap
All Implemented Interfaces:
java.lang.Cloneable, ContextualPropertyCollection<java.lang.Object,java.lang.Object>, PropertyCollection<java.lang.Object,java.lang.Object>
Direct Known Subclasses:
FlyWheelDynamicPropertyCollectionController, FlyWheelDynamicPropertyController

public class DynamicPropertyMap
extends PropertyMap<java.lang.Object,java.lang.Object>
implements ContextualPropertyCollection<java.lang.Object,java.lang.Object>

This class is used to create dynamic property collections that change as their defined type changes

Author:
Steve McDuff

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.PropertyMap
PropertyMap.PropertyIterator, PropertyMap.ValueIterator
 
Nested classes/interfaces inherited from class org.deduced.AbstractPropertyCollection
AbstractPropertyCollection.CollectionToDeleteMonitor
 
Field Summary
private  boolean activated
          is the collection active.
private  RuleExecutionContext context
          rule execution context
private static java.util.IdentityHashMap<PropertyType,java.lang.Object> DEFAULT_VALUES
          map of the possible default values
private static java.util.logging.Logger LOGGER
          logger
private  java.util.Map<PropertyCollection<?,?>,DeducedProperty<java.lang.Object>> rulePropertyMap
          map of all the rules implemented by the type and their properties
private static long serialVersionUID
          serial ID
private  PropertyCollection<?,?> type
          type of the dynamic property map
 
Fields inherited from class org.deduced.PropertyMap
PROPERTY_MAP_TYPE
 
Fields inherited from class org.deduced.AbstractPropertyCollection
CHECK_DELETE_MODE_AUTOMATIC, CHECK_DELETE_MODE_MANUAL, COLLECTION_TO_DELETE
 
Fields inherited from interface org.deduced.PropertyCollection
PROPERTY_COLLECTION_TYPE
 
Constructor Summary
DynamicPropertyMap(PropertyCollection<?,?> setType, boolean setActivated, RuleExecutionContext setContext)
          DynamicPropertyMap Constructor
 
Method Summary
 void activate()
          (non-Javadoc)
protected  void activateOwnedChildCollections()
          activate all Owned Child Collections
static void activateOwnedChildCollections(PropertyCollection<?,?> collectionToActivate)
          activate all Owned Child Collections
 void addDeductionRule(PropertyCollection<?,?> rule)
          add Deduction Rule
private  void applyAllDeductionRuleOverrides()
          apply All Deduction Rule Overrides
private  void applyRuleMissingOverride(PropertyCollection<?,?> rule, DeducedProperty<java.lang.Object> propertyOverride)
          apply Rule Missing Override
static java.lang.Object attemptToCreateValue(PropertyCollection<?,?> changedInstance, RuleExecutionContext context, PropertyCollection<?,?> collectionToInitialize)
          attempt To Create Value
protected  void cleanNewlyClonedValue(AbstractPropertyCollection<java.lang.Object,java.lang.Object> newClone)
          (non-JSDoc)
 java.lang.Object clone()
          (non-Javadoc)
private  void createAllDeducedProperties()
          create All Deduced Properties
private  void createAllDeducedProperties(PropertyCollection<?,?> activateType, java.util.List<PropertyCollection<?,?>> activatedTypes)
          create All Deduced Properties
private  DeducedProperty<java.lang.Object> createDeducedProperty(PropertyCollection deductionRule, DeductionRuleAnalyzer<java.lang.Object> analyzer, PropertyCollection<?,?> lastInstance)
          create Deduced Property
private  void createDeductionRuleProperties(PropertyCollection<?,?> rebuildType)
          create Deduction Rule Properties
private  void createDeductionRuleProperty(PropertyCollection deductionRule)
          create Deduction Rule Property
static java.lang.Object createObjectIfBasicType(PropertyCollection<?,?> type)
          create Object If it is a Basic Type
 void delete()
          (non-Javadoc)
private  void deleteAllDeductionRuleProperties()
          delete All Deduction Rule Properties
 void deleteProperty(java.lang.Object key)
          delete Property
 void deletePropertyInstance(PropertyCollection<?,?> changedInstance)
          delete Property Instance
private  void disconnectCollectionFromPreviousParent(PropertyCollection<?,?> previousParent)
          disconnect Collection From Previous Parent
private static DeducedProperty<java.lang.Object> findMatchingRuleInMap(java.util.List<PropertyCollection<?,?>> reverseInstanceList, PropertyCollection<?,?> ruleToAvoid, DynamicPropertyMap map)
          find a rule in a property map that matches the reverse instance list, overrides other rules and doesn't match one of the rules to avoid.
private static DeducedProperty<java.lang.Object> findOverride(PropertyCollection<?,?> searchPoint, PropertyCollection<?,?> instance, java.util.List<PropertyCollection<?,?>> reverseInstanceList, PropertyCollection<?,?> ruleToAvoid)
          find a property Override based on the parent list
private  void firePropertyChangeEventIfNecessary(PropertyCollection<?,?> instance, java.lang.Object key, java.lang.Object oldValue, java.lang.Object newValue)
          fire Property Change Event If Necessary
 RuleExecutionContext getContext()
          get the rule execution Context
private  PropertyCollection<?,?> getLastOutputInstance(PropertyCollection deductionRule)
          get Last Output Instance
static int getOutputDepth(DeducedProperty<?> property)
          get Output Depth of a rule associated with a deduced property
static java.util.Collection<PropertyCollection<?,?>> getRecursiveParentList(PropertyCollection<?,?> startParent)
          get Recursive Parent List
static java.lang.String getRuleName(DeducedProperty<?> deducedProperty)
          get Rule Name
 DeducedProperty<java.lang.Object> getRuleProperty(PropertyCollection deductionRule)
          get Rule Property
static java.lang.String getTypeName(PropertyCollection<?,?> collection)
          get Type Name
protected  java.lang.Object internalAddProperty(java.lang.Object propertyKey, Property<java.lang.Object> resultAdd)
          (non-Javadoc)
 boolean isActivated()
          (non-Javadoc)
private static boolean isFirstPropertyOverridingSecondProperty(DynamicPropertyMap collectionToOverride, DeducedProperty<java.lang.Object> firstProperty, DeducedProperty<?> secondProperty)
          test if a deduced property overrides another one by first testing the output depth.
static boolean isRuleApplicableToChild(PropertyCollection<?,?> ruleInstanceList, java.util.List<PropertyCollection<?,?>> instanceListToChild)
          check if a Rule is Applicable To Child
 boolean isRulePropertyCreated(PropertyCollection deductionRule)
          test if a Rule Property is Created
private  void overridePropertiesOnChild(java.util.List<PropertyCollection<?,?>> instanceListToChild)
          override Properties On Child based on the list of deduction rule this collection has.
private static void overridePropertyWithRule(DynamicPropertyMap collectionToOverride, java.lang.Object key, DeducedProperty<java.lang.Object> property)
          override Property With Rule
private  void putRuleInRulePropertyMap(DeducedProperty<java.lang.Object> createdProperty)
          put Rule In Rule Property Map
private static void rebuildChildrenOverridesFromPreviousParents(java.util.Collection<PropertyCollection<?,?>> parentList, PropertyCollection<?,?> currentChild)
          this method is used to remove any deduced property on a collection that was created from a parent collection.
 void rebuildProperties()
          rebuild Properties
private  void rebuildProperties(PropertyCollection<?,?> rebuildType, java.util.List<PropertyCollection<?,?>> rebuiltTypes)
          rebuild Properties of a specific type recursively
 void rebuildProperty(PropertyCollection<?,?> changedInstance)
          rebuild Property
private static void rebuildPropertyOverride(DynamicPropertyMap childCollection, DeducedProperty<?> property, PropertyCollection<?,?> ruleToAvoid)
          rebuild Property Override
 void recursivelyOverrideChildProperties(PropertyCollection<?,?> instance)
          recursively Override Child Properties based on the current parent of the collection
 void removeDeductionRule(PropertyCollection<?,?> rule)
          remove Deduction Rule
 Property<java.lang.Object> removeProperty(java.lang.Object propertyKey)
          (non-Javadoc)
 Property<java.lang.Object> removePropertyInstance(java.lang.Object instance)
          (non-Javadoc)
private  void removeRuleOverrides(PropertyCollection<?,?> rule, DeducedProperty<java.lang.Object> propertyOverride)
          remove Rule Overrides
static boolean ruleOutputMatchesReverseInstanceList(PropertyCollection<?,?> rule, java.util.List<PropertyCollection<?,?>> reverseInstanceList)
          verify if a rule Output Matches Reverse Instance List
 void setParent(PropertyCollection<?,?> parent, java.lang.Object keyOnParent)
          (non-Javadoc)
private static boolean setParentOnNewValue(DynamicPropertyMap collectionToOverride, java.lang.Object key, DeducedProperty<java.lang.Object> property, java.lang.Object newValue)
          set Parent On New Value
 java.lang.Object setProperty(java.lang.Object propertyKey, java.lang.Object value)
          (non-Javadoc)
 PropertyCollection<?,?> type()
          (non-Javadoc)
protected  boolean wasThePropertyReference(java.lang.Object propertyKey, java.lang.Object oldValue, boolean isReference)
          test if the old property value was a reference
 
Methods inherited from class org.deduced.PropertyMap
addProperty, areKeysAssignedAutomatically, asKeySet, containsKey, getFixedInstance, getProperty, getPropertyValue, handleRemovedProperty, internalIsSetValueParentNecessary, internalRemoveProperty, internalSetValueParentIfNecessary, isFixedInstanceReference, iterator, iteratorByValue, putPropertyInMap, removePropertyValue, resetRemovedPropertyParent, setFixedInstance, size, validateCollectionParentBeforeAddition
 
Methods inherited from class org.deduced.AbstractPropertyCollection
addListener, asPropertyList, asPropertyMap, asValueList, asValueMap, callObjectClone, classLogger, clear, clearCollectionMonitoredForDelete, cloneCollection, containsInstance, containsValue, createUniqueID, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteRemoveLocalObjectFromParent, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, equals, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getActionInvoker, getCheckDeleteMode, getCheckDeleteRunner, getInstanceIdentityKey, hashCode, id, instanceKey, internalFirePropertyChangeEvent, invokeAction, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, keyOnParent, parent, removeListener, requiresChangeEvent, setActionInvoker, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, toString, updateReference, updateReferenceWithReferenceFlag, validateAllPropertyInstances, validateNoListener, validateNoParentRecursion, validateParentIsNull, validateParentIsNull, valueKey
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deduced.PropertyCollection
addListener, addProperty, areKeysAssignedAutomatically, asKeySet, asPropertyList, asPropertyMap, asValueList, asValueMap, clear, containsInstance, containsKey, containsValue, getFixedInstance, getProperty, getPropertyValue, id, instanceKey, invokeAction, isEmpty, isListenerRegistered, iterator, iteratorByValue, keyOnParent, parent, removeListener, removePropertyValue, setFixedInstance, size, valueKey
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial ID

See Also:
Constant Field Values

LOGGER

private static final java.util.logging.Logger LOGGER
logger


type

private PropertyCollection<?,?> type
type of the dynamic property map


rulePropertyMap

private java.util.Map<PropertyCollection<?,?>,DeducedProperty<java.lang.Object>> rulePropertyMap
map of all the rules implemented by the type and their properties


activated

private boolean activated
is the collection active. If not active, no deduction rule is triggered.


context

private RuleExecutionContext context
rule execution context


DEFAULT_VALUES

private static final java.util.IdentityHashMap<PropertyType,java.lang.Object> DEFAULT_VALUES
map of the possible default values

Constructor Detail

DynamicPropertyMap

public DynamicPropertyMap(PropertyCollection<?,?> setType,
                          boolean setActivated,
                          RuleExecutionContext setContext)
DynamicPropertyMap Constructor

Parameters:
setType - type of the collection
setActivated - is the collection activated
setContext - rule execution context
Method Detail

getContext

public RuleExecutionContext getContext()
get the rule execution Context

Specified by:
getContext in interface ContextualPropertyCollection<java.lang.Object,java.lang.Object>
Returns:
the rule execution context

isActivated

public boolean isActivated()
(non-Javadoc)

Specified by:
isActivated in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
isActivated in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
Returns:
true if the collection is activated
See Also:
AbstractPropertyCollection.isActivated()

activate

public void activate()
(non-Javadoc)

Specified by:
activate in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
activate in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
See Also:
AbstractPropertyCollection.activate()

activateOwnedChildCollections

protected void activateOwnedChildCollections()
activate all Owned Child Collections


activateOwnedChildCollections

public static void activateOwnedChildCollections(PropertyCollection<?,?> collectionToActivate)
activate all Owned Child Collections

Parameters:
collectionToActivate - the collection to activate

applyAllDeductionRuleOverrides

private void applyAllDeductionRuleOverrides()
apply All Deduction Rule Overrides


createAllDeducedProperties

private void createAllDeducedProperties()
create All Deduced Properties


rebuildProperties

public void rebuildProperties()
rebuild Properties


createAllDeducedProperties

private void createAllDeducedProperties(PropertyCollection<?,?> activateType,
                                        java.util.List<PropertyCollection<?,?>> activatedTypes)
create All Deduced Properties

Parameters:
activateType - type to create all the deduced properties from
activatedTypes - list of types that have already been parsed

rebuildProperties

private void rebuildProperties(PropertyCollection<?,?> rebuildType,
                               java.util.List<PropertyCollection<?,?>> rebuiltTypes)
rebuild Properties of a specific type recursively

Parameters:
rebuildType - type to rebuild all the properties
rebuiltTypes - list of all the types that have already been rebuilt

createDeductionRuleProperties

private void createDeductionRuleProperties(PropertyCollection<?,?> rebuildType)
create Deduction Rule Properties

Parameters:
rebuildType - the type to rebuild the rules from

createDeductionRuleProperty

private void createDeductionRuleProperty(PropertyCollection deductionRule)
create Deduction Rule Property

Parameters:
deductionRule - deduction rule model from which to create the property on

getLastOutputInstance

private PropertyCollection<?,?> getLastOutputInstance(PropertyCollection deductionRule)
get Last Output Instance

Parameters:
deductionRule - the deduction rule from which to fetch the last output instance
Returns:
the last output instance

isRulePropertyCreated

public boolean isRulePropertyCreated(PropertyCollection deductionRule)
test if a Rule Property is Created

Parameters:
deductionRule - the deduction rule to check
Returns:
true if the rule property already exists. False otherwise.

getRuleProperty

public DeducedProperty<java.lang.Object> getRuleProperty(PropertyCollection deductionRule)
get Rule Property

Parameters:
deductionRule - the deduction rule
Returns:
the matching property if it exists

putRuleInRulePropertyMap

private void putRuleInRulePropertyMap(DeducedProperty<java.lang.Object> createdProperty)
put Rule In Rule Property Map

Parameters:
createdProperty - the deduced property to put in the rule map

createDeducedProperty

private DeducedProperty<java.lang.Object> createDeducedProperty(PropertyCollection deductionRule,
                                                                DeductionRuleAnalyzer<java.lang.Object> analyzer,
                                                                PropertyCollection<?,?> lastInstance)
                                                         throws java.lang.Exception
create Deduced Property

Parameters:
deductionRule - the deduction rule used to create the property
analyzer - the analyzer used for the property
lastInstance - the last instance in the rule output
Returns:
the created deduced property
Throws:
java.lang.Exception - any exception detected while executing the rule

overridePropertyWithRule

private static void overridePropertyWithRule(DynamicPropertyMap collectionToOverride,
                                             java.lang.Object key,
                                             DeducedProperty<java.lang.Object> property)
override Property With Rule

Parameters:
collectionToOverride - the collection to override
key - the key of the property to override
property - the property to use during the override

setParentOnNewValue

private static boolean setParentOnNewValue(DynamicPropertyMap collectionToOverride,
                                           java.lang.Object key,
                                           DeducedProperty<java.lang.Object> property,
                                           java.lang.Object newValue)
set Parent On New Value

Parameters:
collectionToOverride - the parent of the new value
key - the key of the new value on the parent
property - the property used to override
newValue - the new value on which we set the parent
Returns:
true if the operation was successful

isFirstPropertyOverridingSecondProperty

private static boolean isFirstPropertyOverridingSecondProperty(DynamicPropertyMap collectionToOverride,
                                                               DeducedProperty<java.lang.Object> firstProperty,
                                                               DeducedProperty<?> secondProperty)
test if a deduced property overrides another one by first testing the output depth. Properties with deeper outputs take precedence over shallow outputs. If the output depth is equal, then the rule which is lower in the type hierarchy will take precedence. If both rules come from the same type, then a warning log is generated and the second rule takes precedence out of stale mate.

Parameters:
collectionToOverride - the collection to override
firstProperty - the first deduced property
secondProperty - the second property to compare to the first
Returns:
true if the first property should override the second

getRuleName

public static java.lang.String getRuleName(DeducedProperty<?> deducedProperty)
get Rule Name

Parameters:
deducedProperty - the deduced property from which to fetch the rule name
Returns:
the rule name of the property

getTypeName

public static java.lang.String getTypeName(PropertyCollection<?,?> collection)
get Type Name

Parameters:
collection - the collection from which to fetch the type name
Returns:
the type name

getOutputDepth

public static int getOutputDepth(DeducedProperty<?> property)
get Output Depth of a rule associated with a deduced property

Parameters:
property - the deduced property
Returns:
the rule output depth

firePropertyChangeEventIfNecessary

private void firePropertyChangeEventIfNecessary(PropertyCollection<?,?> instance,
                                                java.lang.Object key,
                                                java.lang.Object oldValue,
                                                java.lang.Object newValue)
fire Property Change Event If Necessary

Parameters:
instance - the instance that changed
key - the key that changed
oldValue - the old value
newValue - the new value

setParent

public void setParent(PropertyCollection<?,?> parent,
                      java.lang.Object keyOnParent)
(non-Javadoc)

Specified by:
setParent in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
setParent in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
Parameters:
parent - The parent to set.
keyOnParent - the key on the parent to reference this object
See Also:
AbstractPropertyCollection.setParent(org.deduced.PropertyCollection, java.lang.Object)

disconnectCollectionFromPreviousParent

private void disconnectCollectionFromPreviousParent(PropertyCollection<?,?> previousParent)
disconnect Collection From Previous Parent

Parameters:
previousParent - the previous parent to disconnect from

rebuildChildrenOverridesFromPreviousParents

private static void rebuildChildrenOverridesFromPreviousParents(java.util.Collection<PropertyCollection<?,?>> parentList,
                                                                PropertyCollection<?,?> currentChild)
this method is used to remove any deduced property on a collection that was created from a parent collection. It is used when we move the collection around and the parent changes. When rebuilding a property, the same value as the override is preserved unless a the collection has a deduction rule that points to this output already. This method will also parse all the owned objects under this collection to ensure that they too get their overridden properties removed.

Parameters:
parentList - list of parents that are no longer a parent to this collection.
currentChild - child which will see all the properties that were overridden by its parent rebuilt.

rebuildPropertyOverride

private static void rebuildPropertyOverride(DynamicPropertyMap childCollection,
                                            DeducedProperty<?> property,
                                            PropertyCollection<?,?> ruleToAvoid)
rebuild Property Override

Parameters:
childCollection - the child collection that contains the property to rebuild
property - the previous property
ruleToAvoid - the rules to avoid

findOverride

private static DeducedProperty<java.lang.Object> findOverride(PropertyCollection<?,?> searchPoint,
                                                              PropertyCollection<?,?> instance,
                                                              java.util.List<PropertyCollection<?,?>> reverseInstanceList,
                                                              PropertyCollection<?,?> ruleToAvoid)
find a property Override based on the parent list

Parameters:
searchPoint - the collection where to begin the search
instance - the instance that might need an override
reverseInstanceList - the list of instances leading to this object
ruleToAvoid - the rules to avoid
Returns:
the property override

findMatchingRuleInMap

private static DeducedProperty<java.lang.Object> findMatchingRuleInMap(java.util.List<PropertyCollection<?,?>> reverseInstanceList,
                                                                       PropertyCollection<?,?> ruleToAvoid,
                                                                       DynamicPropertyMap map)
find a rule in a property map that matches the reverse instance list, overrides other rules and doesn't match one of the rules to avoid.

Parameters:
reverseInstanceList - the reverse instance list of the rule
ruleToAvoid - the rules to avoid
map - the map on which to search
Returns:
the matching deduction rule property

ruleOutputMatchesReverseInstanceList

public static boolean ruleOutputMatchesReverseInstanceList(PropertyCollection<?,?> rule,
                                                           java.util.List<PropertyCollection<?,?>> reverseInstanceList)
verify if a rule Output Matches Reverse Instance List

Parameters:
rule - the rule to match
reverseInstanceList - the reverse instance list
Returns:
true if the rule output matches

getRecursiveParentList

public static java.util.Collection<PropertyCollection<?,?>> getRecursiveParentList(PropertyCollection<?,?> startParent)
get Recursive Parent List

Parameters:
startParent - the start collection to get all the parents from. This parent will be included in the returned list.
Returns:
the recursive parent list sorted from closest parent to farthest.

deletePropertyInstance

public void deletePropertyInstance(PropertyCollection<?,?> changedInstance)
delete Property Instance

Parameters:
changedInstance - the instance that was removed

deleteProperty

public void deleteProperty(java.lang.Object key)
delete Property

Parameters:
key - the property key to delete

rebuildProperty

public void rebuildProperty(PropertyCollection<?,?> changedInstance)
rebuild Property

Parameters:
changedInstance - the instance that changed

removeProperty

public Property<java.lang.Object> removeProperty(java.lang.Object propertyKey)
(non-Javadoc)

Specified by:
removeProperty in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
removeProperty in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
propertyKey - the key of the property
Returns:
the removed property, null if remove failed
See Also:
PropertyMap.removeProperty(java.lang.Object)

removePropertyInstance

public Property<java.lang.Object> removePropertyInstance(java.lang.Object instance)
(non-Javadoc)

Specified by:
removePropertyInstance in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
removePropertyInstance in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
instance - the object to remove
Returns:
the removed object
See Also:
PropertyMap.removePropertyInstance(java.lang.Object)

attemptToCreateValue

public static java.lang.Object attemptToCreateValue(PropertyCollection<?,?> changedInstance,
                                                    RuleExecutionContext context,
                                                    PropertyCollection<?,?> collectionToInitialize)
attempt To Create Value

Parameters:
changedInstance - the value that changed
context - the rule execution context used to create child values
collectionToInitialize - the collection to initialize
Returns:
the property value

createObjectIfBasicType

public static java.lang.Object createObjectIfBasicType(PropertyCollection<?,?> type)
create Object If it is a Basic Type

Parameters:
type - the type to create
Returns:
the created object. Null if we were unable to create it.

type

public PropertyCollection<?,?> type()
(non-Javadoc)

Specified by:
type in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
type in class PropertyMap<java.lang.Object,java.lang.Object>
Returns:
the property description
See Also:
PropertyMap.type()

internalAddProperty

protected java.lang.Object internalAddProperty(java.lang.Object propertyKey,
                                               Property<java.lang.Object> resultAdd)
(non-Javadoc)

Overrides:
internalAddProperty in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
propertyKey - the key of the added property
resultAdd - the property to add to the map
Returns:
the added property value
See Also:
PropertyMap.internalAddProperty(java.lang.Object, org.deduced.Property)

recursivelyOverrideChildProperties

public void recursivelyOverrideChildProperties(PropertyCollection<?,?> instance)
recursively Override Child Properties based on the current parent of the collection

Parameters:
instance - the instance to check for override on the parent list

overridePropertiesOnChild

private void overridePropertiesOnChild(java.util.List<PropertyCollection<?,?>> instanceListToChild)
override Properties On Child based on the list of deduction rule this collection has.

Parameters:
instanceListToChild - the list of instances leading to a specific child.

applyRuleMissingOverride

private void applyRuleMissingOverride(PropertyCollection<?,?> rule,
                                      DeducedProperty<java.lang.Object> propertyOverride)
apply Rule Missing Override

Parameters:
rule - the rule to apply
propertyOverride - the property to use in the override

isRuleApplicableToChild

public static boolean isRuleApplicableToChild(PropertyCollection<?,?> ruleInstanceList,
                                              java.util.List<PropertyCollection<?,?>> instanceListToChild)
check if a Rule is Applicable To Child

Parameters:
ruleInstanceList - the rule output instance list
instanceListToChild - the instance list to the child
Returns:
true if the rule is applicable

setProperty

public java.lang.Object setProperty(java.lang.Object propertyKey,
                                    java.lang.Object value)
(non-Javadoc)

Specified by:
setProperty in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
setProperty in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
propertyKey - the key of the property
value - the new value of the property. If the property is a collection that is not by reference, this method requires that the passed collection has a parent set to null since it will reset the parent.
Returns:
the added value instance
See Also:
PropertyMap.setProperty(java.lang.Object, java.lang.Object)

wasThePropertyReference

protected boolean wasThePropertyReference(java.lang.Object propertyKey,
                                          java.lang.Object oldValue,
                                          boolean isReference)
test if the old property value was a reference

Parameters:
propertyKey - the property key
oldValue - the old value
isReference - is the property currently a reference
Returns:
true if the property was a reference.

clone

public java.lang.Object clone()
(non-Javadoc)

Specified by:
clone in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
clone in class PropertyMap<java.lang.Object,java.lang.Object>
Returns:
the object clone
See Also:
PropertyMap.clone()

cleanNewlyClonedValue

protected void cleanNewlyClonedValue(AbstractPropertyCollection<java.lang.Object,java.lang.Object> newClone)
(non-JSDoc)

Overrides:
cleanNewlyClonedValue in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
newClone - the newly created clone of the current collection
See Also:
PropertyMap.cleanNewlyClonedValue(org.deduced.AbstractPropertyCollection)

delete

public void delete()
(non-Javadoc)

Specified by:
delete in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
delete in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
See Also:
AbstractPropertyCollection.delete()

deleteAllDeductionRuleProperties

private void deleteAllDeductionRuleProperties()
delete All Deduction Rule Properties


removeDeductionRule

public void removeDeductionRule(PropertyCollection<?,?> rule)
remove Deduction Rule

Parameters:
rule - the rule to remove

removeRuleOverrides

private void removeRuleOverrides(PropertyCollection<?,?> rule,
                                 DeducedProperty<java.lang.Object> propertyOverride)
remove Rule Overrides

Parameters:
rule - the rule to remove
propertyOverride - the property that was used to override the rule

addDeductionRule

public void addDeductionRule(PropertyCollection<?,?> rule)
add Deduction Rule

Parameters:
rule - the rule to add