org.deduced.dynamic
Class DynamicPropertyMap

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

public class DynamicPropertyMap
extends PropertyMap<java.lang.Integer,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)
 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)
          attempt To Create Value
 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 Property<java.lang.Object> findMatchingRuleInMap(java.util.List<PropertyCollection<?,?>> reverseInstanceList, java.util.List<PropertyCollection<?,?>> rulesToAvoid, DynamicPropertyMap map)
          find a rule in a property map that matches the reverse instance list and doesn't match one of the rules to avoid.
private static Property<java.lang.Object> findOverride(PropertyCollection<?,?> searchPoint, PropertyCollection<?,?> instance, java.util.Collection<PropertyCollection<?,?>> parentListToAvoid, java.util.List<PropertyCollection<?,?>> reverseInstanceList, java.util.List<PropertyCollection<?,?>> rulesToAvoid)
          find a property Override based on the parent list
private  void firePropertyChangeEventIfNecessary(PropertyCollection<?,?> instance, java.lang.Integer key, java.lang.Object oldValue, java.lang.Object newValue)
          fire Property Change Event If Necessary
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
static java.lang.String getTypeName(PropertyCollection<?,?> collection)
          get Type Name
protected  java.lang.Integer internalAddProperty(java.lang.Integer propertyKey, Property<java.lang.Object> resultAdd)
          (non-Javadoc)
 boolean isActivated()
          (non-Javadoc)
private static boolean isOutputDeeper(DynamicPropertyMap collectionToOverride, DeducedProperty<java.lang.Object> property, DeducedProperty<?> oldDeducedProperty)
          is Output of the current rule Deeper than the current rule
static boolean isRuleApplicableToChild(PropertyCollection<?,?> ruleInstanceList, java.util.List<PropertyCollection<?,?>> instanceListToChild)
          check if a Rule is Applicable To Child
private  void logRuleCreationResult(PropertyCollection deductionRule, CompileResult result)
          log Rule Creation Result
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.Integer 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, Property<?> property, java.util.Collection<PropertyCollection<?,?>> parentListToAvoid, java.util.List<PropertyCollection<?,?>> rulesToAvoid)
          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
private  boolean resetParentOnOldValue(java.lang.Integer propertyKey, java.lang.Object oldValue, boolean isReference)
          reset Parent On Old Value
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.Integer key, DeducedProperty<java.lang.Object> property, java.lang.Object newValue)
          set Parent On New Value
 java.lang.Object setProperty(java.lang.Integer propertyKey, java.lang.Object value)
          (non-Javadoc)
 PropertyCollection<?,?> type()
          (non-Javadoc)
private  void validateCreatedAnalyzerClass(java.lang.Object newInstance)
          validate Created Analyzer Class
private  void validateOutputListSize(PropertyCollection deductionRule, int outputListSize)
          validate Output List Size.
private  void validateOutputType(PropertyCollection deductionRule, PropertyCollection<?,?> output)
          validate Output Type.
 
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
 
Methods inherited from class org.deduced.AbstractPropertyCollection
addListener, asPropertyList, asPropertyMap, asValueList, asValueMap, callObjectClone, classLogger, clear, clearCollectionMonitoredForDelete, cloneCollection, containsInstance, containsValue, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteRemoveLocalObjectFromParent, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, equals, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getCheckDeleteMode, getCheckDeleteRunner, getInstanceIdentityKey, hashCode, instanceKey, internalFirePropertyChangeEvent, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, keyOnParent, parent, removeListener, requiresChangeEvent, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, toString, updateReference, updateReferenceWithReferenceFlag, validateAllPropertyInstances, validateNoParentRecursion, validateParentIsNull, validateParentIsNull, valueKey
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

isActivated

public boolean isActivated()
(non-Javadoc)

Specified by:
isActivated in interface PropertyCollection<java.lang.Integer,java.lang.Object>
Overrides:
isActivated in class AbstractPropertyCollection<java.lang.Integer,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.Integer,java.lang.Object>
Overrides:
activate in class AbstractPropertyCollection<java.lang.Integer,java.lang.Object>
See Also:
AbstractPropertyCollection.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

validateCreatedAnalyzerClass

private void validateCreatedAnalyzerClass(java.lang.Object newInstance)
                                   throws java.lang.IllegalArgumentException
validate Created Analyzer Class

Parameters:
newInstance - the potential analyzer
Throws:
java.lang.IllegalArgumentException - if the object isn't an instance of DeductionRuleAnalyzer

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)
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

logRuleCreationResult

private void logRuleCreationResult(PropertyCollection deductionRule,
                                   CompileResult result)
log Rule Creation Result

Parameters:
deductionRule - the rule we tried to create
result - the compilation result

validateOutputListSize

private void validateOutputListSize(PropertyCollection deductionRule,
                                    int outputListSize)
validate Output List Size. the output list must not be empty.

Parameters:
deductionRule - the rule we are creating
outputListSize - the output list size

validateOutputType

private void validateOutputType(PropertyCollection deductionRule,
                                PropertyCollection<?,?> output)
validate Output Type. Output type isn't allowed to be static

Parameters:
deductionRule - the rule we are creating
output - the current output

overridePropertyWithRule

private static void overridePropertyWithRule(DynamicPropertyMap collectionToOverride,
                                             java.lang.Integer 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.Integer 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

isOutputDeeper

private static boolean isOutputDeeper(DynamicPropertyMap collectionToOverride,
                                      DeducedProperty<java.lang.Object> property,
                                      DeducedProperty<?> oldDeducedProperty)
is Output of the current rule Deeper than the current rule

Parameters:
collectionToOverride - the collection to override
property - the current rule we are trying to apply
oldDeducedProperty - the old rule
Returns:
true if the current output depth is deeper

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.Integer 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.Integer,java.lang.Object>
Overrides:
setParent in class AbstractPropertyCollection<java.lang.Integer,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,
                                            Property<?> property,
                                            java.util.Collection<PropertyCollection<?,?>> parentListToAvoid,
                                            java.util.List<PropertyCollection<?,?>> rulesToAvoid)
rebuild Property Override

Parameters:
childCollection - the child collection that contains the property to rebuild
property - the previous property
parentListToAvoid - the list of parents to avoid
rulesToAvoid - the list of rules to avoid

findOverride

private static Property<java.lang.Object> findOverride(PropertyCollection<?,?> searchPoint,
                                                       PropertyCollection<?,?> instance,
                                                       java.util.Collection<PropertyCollection<?,?>> parentListToAvoid,
                                                       java.util.List<PropertyCollection<?,?>> reverseInstanceList,
                                                       java.util.List<PropertyCollection<?,?>> rulesToAvoid)
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
parentListToAvoid - the list of parents to avoid
reverseInstanceList - the list of instances leading to this object
rulesToAvoid - the list of rules to avoid
Returns:
the property override

findMatchingRuleInMap

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

Parameters:
reverseInstanceList - the reverse instance list of the rule
rulesToAvoid - 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.Integer,java.lang.Object>
Overrides:
removeProperty in class PropertyMap<java.lang.Integer,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.Integer,java.lang.Object>
Overrides:
removePropertyInstance in class PropertyMap<java.lang.Integer,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)
attempt To Create Value

Parameters:
changedInstance - the value that changed
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.Integer,java.lang.Object>
Overrides:
type in class PropertyMap<java.lang.Integer,java.lang.Object>
Returns:
the property description
See Also:
PropertyMap.type()

internalAddProperty

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

Overrides:
internalAddProperty in class PropertyMap<java.lang.Integer,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.Integer propertyKey,
                                    java.lang.Object value)
(non-Javadoc)

Specified by:
setProperty in interface PropertyCollection<java.lang.Integer,java.lang.Object>
Overrides:
setProperty in class PropertyMap<java.lang.Integer,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)

resetParentOnOldValue

private boolean resetParentOnOldValue(java.lang.Integer propertyKey,
                                      java.lang.Object oldValue,
                                      boolean isReference)
reset Parent On Old Value

Parameters:
propertyKey - the old value key
oldValue - the old value
isReference - is the instance to the old value a reference
Returns:
true if the old value was held by reference

clone

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

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

delete

public void delete()
(non-Javadoc)

Specified by:
delete in interface PropertyCollection<java.lang.Integer,java.lang.Object>
Overrides:
delete in class AbstractPropertyCollection<java.lang.Integer,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