org.deduced
Class FixedPropertyInstanceCollection<K,V>

java.lang.Object
  extended by org.deduced.AbstractPropertyCollection<K,V>
      extended by org.deduced.FixedPropertyInstanceCollection<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
java.lang.Cloneable, PropertyCollection<K,V>
Direct Known Subclasses:
AbstractLanguageCollectionImplementation, AbstractTextBuilderImplementation, AbstractTextCollectionImplementation, ActionImplementation, BigDecimalInitializationModelImplementation, BigIntegerInitializationModelImplementation, BooleanInitializationModelImplementation, ByteInitializationModelImplementation, CalendarInitializationModelImplementation, CharacterInitializationModelImplementation, CollectionTypeControllerPackageImplementation, CollectionTypeInformationImplementation, CompiledModelImplementation, ConfigurationImplementation, ConfiguredCollectionImplementation, ContexedCollectionImplementation, ContextImplementation, CreationInitializationModelImplementation, DeducedApplicationLayerImplementation, DeducedControllerLayerImplementation, DeducedControllerLayerLinkedCollectionImplementation, DeducedModelLayerImplementation, DeducedSchemaLayerImplementation, DeductionRuleImplementation, DefaultPropertyCollectionControllerModelImplementation, DefaultPropertyControllerModelImplementation, DocumentedCollectionImplementation, DoubleInitializationModelImplementation, EnabledPropertyCollectionImplementation, EnumerationPropertyCollectionImplementation, EnumerationPropertyTypeImplementation, EnumerationValidationModelImplementation, EnumerationValidatorImplementation, ErrorMessageBasedValidatorImplementation, FloatInitializationModelImplementation, FolderImplementation, FormattedMultilanguageTextBuilderImplementation, InitializationModelImplementation, InstanceReferenceImplementation, InstanceReferenceInitializationModelImplementation, IntegerInitializationModelImplementation, LanguageImplementation, LanguageSpecificTextConfigurationImplementation, LinkedValidationModelImplementation, LongInitializationModelImplementation, ManuallyOrderedInstanceReferenceImplementation, ManuallyOrderedParameterImplementation, ManuallyOrderedTypeImplementation, MultilanguageTextBuilderImplementation, MultilanguageTextConfigurationImplementation, NamedPropertyCollectionImplementation, NullableValidationModelImplementation, NullableValidatorImplementation, NumberValidationModelImplementation, NumberValidatorImplementation, OrderedInstanceReferenceImplementation, OrderedParameterImplementation, OrderedPropertyListTypeImplementation, OrderingPropertyCollectionTypeImplementation, ParameterImplementation, PropertyCollectionControllerModelImplementation, PropertyCollectionListInstanceImplementation, PropertyCollectionTypeImplementation, PropertyControllerModelImplementation, PropertyInstanceImplementation, PropertyPackageImplementation, PropertyTypeImplementation, ReferenceInitializationModelImplementation, SchemaAnalyzerImplementation, SchemaBasedApplicationLayerImplementation, ShortInitializationModelImplementation, SingleItemListFilterImplementation, StaticInstanceReferenceImplementation, StaticInstanceReferenceInitializationModelImplementation, StringInitializationModelImplementation, StringValidationModelImplementation, StringValidatorImplementation, TaskImplementation, TaskMonitorImplementation, TextConfigurationImplementation, TypeCreationValidationModelImplementation, TypeCreationValidatorImplementation, TypedCollectionControllerImplementation, TypedCollectionListControllerImplementation, TypedControllerPackageImplementation, TypedControllerSchemaImplementation, TypedPropertyControllerImplementation, TypeReferenceValidationModelImplementation, TypeReferenceValidatorImplementation, UtilitiesImplementation, ValidationModelImplementation, ValidatorImplementation

public abstract class FixedPropertyInstanceCollection<K,V>
extends AbstractPropertyCollection<K,V>

Abstract property collection used as a base class for property collections that have a fixed list of properties. This class will block add/remove methods and will use the key list to provide iterators, list and map access to the underlying class

Author:
Steve McDuff

Nested Class Summary
private  class FixedPropertyInstanceCollection.FixedPropertyListIterator
          Iterator for the fixed property collection.
private  class FixedPropertyInstanceCollection.FixedPropertyListValueIterator
          Iterator for the fixed property collection.
 
Nested classes/interfaces inherited from class org.deduced.AbstractPropertyCollection
AbstractPropertyCollection.CollectionToDeleteMonitor
 
Field Summary
private static long serialVersionUID
          serial ID
 
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
FixedPropertyInstanceCollection()
          default constructor
 
Method Summary
 K addProperty(K key, PropertyCollection<?,?> instance, V value)
          (non-Javadoc)
 boolean areKeysAssignedAutomatically()
          (non-Javadoc)
 boolean containsKey(java.lang.Object key)
          (non-Javadoc)
private  PropertyCollection<?,?> findInstance(java.lang.Object key)
          Fetch the property instance that matches the specified key from the property collection type
private static PropertyCollection<?,?> findInstance(java.lang.Object key, PropertyCollection<?,?> type)
          Fetch the property instance that matches the specified key from the property collection type.
 Property<V> getProperty(java.lang.Object key)
          (non-Javadoc)
 java.util.Iterator<Property<V>> iterator()
          (non-Javadoc)
 java.util.Iterator<V> iteratorByValue()
          (non-Javadoc)
 Property<V> removeProperty(java.lang.Object key)
          (non-Javadoc)
 Property<V> removePropertyInstance(V instance)
          (non-Javadoc)
 Property<V> removePropertyValue(V value)
          (non-Javadoc)
 V setProperty(K key, V value)
          (non-Javadoc)
 int size()
          (non-Javadoc)
 
Methods inherited from class org.deduced.AbstractPropertyCollection
activate, addListener, asPropertyList, asPropertyMap, asValueList, asValueMap, callObjectClone, classLogger, cleanNewlyClonedValue, clear, clearCollectionMonitoredForDelete, clone, cloneCollection, containsInstance, containsValue, createUniqueID, delete, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteRemoveLocalObjectFromParent, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, equals, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getActionInvoker, getCheckDeleteMode, getCheckDeleteRunner, getFixedInstance, getInstanceIdentityKey, hashCode, id, instanceKey, internalFirePropertyChangeEvent, invokeAction, isActivated, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, keyOnParent, parent, removeListener, requiresChangeEvent, setActionInvoker, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, setFixedInstance, setParent, 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
asKeySet, getPropertyValue, type
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial ID

See Also:
Constant Field Values
Constructor Detail

FixedPropertyInstanceCollection

public FixedPropertyInstanceCollection()
default constructor

Method Detail

removeProperty

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

Parameters:
key - the key of the property
Returns:
the removed property, null if remove failed
See Also:
PropertyCollection.removeProperty(java.lang.Object)

removePropertyValue

public Property<V> removePropertyValue(V value)
(non-Javadoc)

Parameters:
value - the value to remove
Returns:
the removed object
See Also:
PropertyCollection.removePropertyValue(java.lang.Object)

removePropertyInstance

public Property<V> removePropertyInstance(V instance)
(non-Javadoc)

Parameters:
instance - the object to remove
Returns:
the removed object
See Also:
PropertyCollection.removePropertyInstance(java.lang.Object)

addProperty

public K addProperty(K key,
                     PropertyCollection<?,?> instance,
                     V value)
(non-Javadoc)

Parameters:
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 thrown
instance - 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 thrown
value - 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
Returns:
the added property key
See Also:
PropertyCollection.addProperty(java.lang.Object, org.deduced.PropertyCollection, java.lang.Object)

size

public int size()
(non-Javadoc)

Returns:
the collection size
See Also:
PropertyCollection.size()

iterator

public java.util.Iterator<Property<V>> iterator()
(non-Javadoc)

Returns:
an iterator that iterates through the Property objects
See Also:
PropertyCollection.iterator()

iteratorByValue

public java.util.Iterator<V> iteratorByValue()
(non-Javadoc)

Returns:
an iterator that iterates through the Property values
See Also:
PropertyCollection.iteratorByValue()

getProperty

public Property<V> getProperty(java.lang.Object key)
(non-Javadoc)

Parameters:
key - the property key
Returns:
the property, null if the get failed
See Also:
PropertyCollection.getProperty(java.lang.Object)

findInstance

private PropertyCollection<?,?> findInstance(java.lang.Object key)
Fetch the property instance that matches the specified key from the property collection type

Parameters:
key - the property instance key
Returns:
the property instance

findInstance

private static PropertyCollection<?,?> findInstance(java.lang.Object key,
                                                    PropertyCollection<?,?> type)
Fetch the property instance that matches the specified key from the property collection type. This method will browse all the property collection type parent hierarchy to find the required instance.

Parameters:
key - the property instance key
type - the property collection type to search
Returns:
the property instance that matches the key

containsKey

public boolean containsKey(java.lang.Object key)
(non-Javadoc)

Parameters:
key - the property key
Returns:
true if the key is contained in this collection
See Also:
PropertyCollection.containsKey(java.lang.Object)

areKeysAssignedAutomatically

public boolean areKeysAssignedAutomatically()
(non-Javadoc)

Returns:
true if the keys are assigned automatically by the collection
See Also:
PropertyCollection.areKeysAssignedAutomatically()

setProperty

public V setProperty(K key,
                     V value)
(non-Javadoc)

Parameters:
key - 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:
PropertyCollection.setProperty(java.lang.Object, java.lang.Object)