|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deduced.AbstractPropertyCollection<K,V>
org.deduced.PropertyMap<java.lang.Object,V>
org.deduced.IdPropertyMap<V>
V
- the type of value in the mappublic class IdPropertyMap<V>
IdPropertyMap. This class has 2 different behaviors. If the instance is by reference, keys are automatically assigned with an incremental counter. If keys are held by value, the property collection use their system unique ID as a key. This implies that this collection may not receive multiple times the same value instance.
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 int |
nextKey
integer used to generate keys when the list contains references |
private static long |
serialVersionUID
the serial version |
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 | |
---|---|
IdPropertyMap()
default constructor |
|
IdPropertyMap(java.util.Map<java.lang.Object,Property<V>> mapToUse,
PropertyCollection<?,?> setFixedInstance)
constructor for IdPropertyMap |
|
IdPropertyMap(PropertyCollection<?,?> setFixedInstance)
constructor for IdPropertyMap |
Method Summary | |
---|---|
java.lang.Object |
addProperty(java.lang.Object key,
PropertyCollection<?,?> instance,
V value)
(non-Javadoc) |
boolean |
areKeysAssignedAutomatically()
(non-Javadoc) |
protected java.lang.IllegalArgumentException |
createThrowMustNotSpecifyKeyError()
method to throw the error generated when a key is specified during addition while IdPropertyMap doesn't allow this. |
boolean |
equals(java.lang.Object obj)
(non-Javadoc) |
protected java.lang.Object |
generateKey(java.lang.Object value)
generate a key for a newly inserted object |
int |
hashCode()
(non-Javadoc) |
java.lang.Object |
instanceKey(java.lang.Object instance)
(non-Javadoc) |
private boolean |
isBaseInformationEqual(PropertyCollection<?,?> otherMap)
check if the base map information is equal such as type, size and fixed instance. |
private boolean |
isMapContentEqual(PropertyCollection<?,?> otherMap)
is the map content equal by verifying objects one by one. |
Property<V> |
removePropertyInstance(V instance)
(non-Javadoc) |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private int nextKey
Constructor Detail |
---|
public IdPropertyMap()
public IdPropertyMap(java.util.Map<java.lang.Object,Property<V>> mapToUse, PropertyCollection<?,?> setFixedInstance)
mapToUse
- the map to use to store the valuessetFixedInstance
- the fixed instance contained in this collectionpublic IdPropertyMap(PropertyCollection<?,?> setFixedInstance)
setFixedInstance
- the fixed instance contained in this collectionMethod Detail |
---|
protected java.lang.IllegalArgumentException createThrowMustNotSpecifyKeyError()
public java.lang.Object addProperty(java.lang.Object key, PropertyCollection<?,?> instance, V value)
addProperty
in interface PropertyCollection<java.lang.Object,V>
addProperty
in class PropertyMap<java.lang.Object,V>
key
- the key of the property. Some collections assign keys
automatically, for those collections, a null value is
expected. If the key is specified when they are assigned
automatically, an IllegalArgumentException will be throwninstance
- the property instance to add. Most collections assign the
instance automatically, for those collections, the instance
can either be null or be the same as the instance that is
automatically assigned, otherwise an error will be thrownvalue
- the property value. If the value is a property collection,
then the collection is expected to have a null parent if the
instance is owned (not by reference), otherwise an
IllegalArgumentException will be thrown
PropertyMap.addProperty(java.lang.Object,
org.deduced.PropertyCollection, java.lang.Object)
protected java.lang.Object generateKey(java.lang.Object value)
value
- the value to insert
public Property<V> removePropertyInstance(V instance)
removePropertyInstance
in interface PropertyCollection<java.lang.Object,V>
removePropertyInstance
in class PropertyMap<java.lang.Object,V>
instance
- the object to remove
PropertyCollection.removePropertyInstance(java.lang.Object)
public java.lang.Object instanceKey(java.lang.Object instance)
instanceKey
in interface PropertyCollection<java.lang.Object,V>
instanceKey
in class AbstractPropertyCollection<java.lang.Object,V>
instance
- the object instance
PropertyCollection.instanceKey(java.lang.Object)
public boolean areKeysAssignedAutomatically()
areKeysAssignedAutomatically
in interface PropertyCollection<java.lang.Object,V>
areKeysAssignedAutomatically
in class PropertyMap<java.lang.Object,V>
PropertyCollection.areKeysAssignedAutomatically()
public boolean equals(java.lang.Object obj)
equals
in class AbstractPropertyCollection<java.lang.Object,V>
AbstractPropertyCollection.equals(java.lang.Object)
private boolean isBaseInformationEqual(PropertyCollection<?,?> otherMap)
otherMap
- the other map to verify
private boolean isMapContentEqual(PropertyCollection<?,?> otherMap)
otherMap
- the other map to verify
public int hashCode()
hashCode
in class AbstractPropertyCollection<java.lang.Object,V>
AbstractPropertyCollection.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |