com.inline.feature.common
Class AggregateFeatureSet

java.lang.Object
  |
  +--com.inline.feature.common.AbstractResourceListener
        |
        +--com.inline.feature.common.AbstractFeatureSet
              |
              +--com.inline.feature.common.AggregateFeatureSet

public class AggregateFeatureSet
extends AbstractFeatureSet
implements FeatureSetListener

FeatureSet that aggregates other FeatureSets and forwards messages to them. It is used by AbstractFeatureModel to allocate sets of children for Features.

See Also:
AbstractFeatureModel.getChildFeatureSet(Feature)

Fields inherited from class com.inline.feature.common.AbstractResourceListener
active, featureModel, parent, resourceAdapters, resourceSetAdapters, revalidate
 
Constructor Summary
AggregateFeatureSet(Feature parent)
           
 
Method Summary
protected  void activate()
          Registers this object as an observer on all registered resource adapters and resource set adapters, then it calls invalidate() on self to restart the resource parsing process.
 void addFeatureSet(java.lang.String type, FeatureSet set)
           
protected  Feature allocateFeature(java.lang.String type, java.lang.String signature)
           
 void featureAdded(FeatureSet set, Feature feature)
           
 void featureRemoved(FeatureSet set, Feature feature)
           
 void featureReplaced(FeatureSet set, Feature oldFeature, Feature newFeature)
           
 Feature getFeature(java.lang.String type, java.lang.String signature)
          Finds the feature that has the specified type and signature
 com.sun.java.util.collections.Set getFeatureConstructors()
          Returns a set of FeatureConstructor objects suitable for the use in the context of this feature set's parent.
 com.sun.java.util.collections.Set getFeatures()
          Returns all features handled by this set.
 com.sun.java.util.collections.Set getFeatures(java.lang.String type)
          Returns a subset of features which have the specified type.
protected  com.sun.java.util.collections.Set getPrimitiveFeatureConstructors(java.lang.String type)
          Returns a set of basic feature constructors which can be used to build features of the specified type.
 Feature[] getSortedFeatures()
          Returns features sorted according to their DisplayProperty's preferences.
 boolean isEmpty()
          This method exists for optimization purposes.
protected  void passivate()
          Unregisters this object as an observer from all registered resource adapters and resource set adapters.
 void release()
          This method is called when the parent feature is removed from the feature tree.
 
Methods inherited from class com.inline.feature.common.AbstractFeatureSet
addFeatureSetListener, fireFeatureAdded, fireFeatureRemoved, fireFeatureReplaced, getDefaultFeatureConstructor, getFeatureConstructor, getFeatureConstructors, removeFeatureSetListener, shouldCheckHasChildren
 
Methods inherited from class com.inline.feature.common.AbstractResourceListener
getFeatureModel, getParent, invalidate, propertyChange, registerDependencies, registerResourceAdapter, registerResourceAdapter, registerResourceSetAdapter, registerResourceSetAdapter, resourceAdded, resourceChanged, resourceRemoved, unregisterResourceAdapter, unregisterResourceSetAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateFeatureSet

public AggregateFeatureSet(Feature parent)
Method Detail

addFeatureSet

public void addFeatureSet(java.lang.String type,
                          FeatureSet set)

allocateFeature

protected Feature allocateFeature(java.lang.String type,
                                  java.lang.String signature)

getFeatures

public com.sun.java.util.collections.Set getFeatures()
Description copied from interface: FeatureSet
Returns all features handled by this set. The result may not reflect real situation if the feature set is inactive.

getFeatures

public com.sun.java.util.collections.Set getFeatures(java.lang.String type)
Description copied from interface: FeatureSet
Returns a subset of features which have the specified type. Will return null if the specified type is not a supported child type for this feature.

getFeature

public Feature getFeature(java.lang.String type,
                          java.lang.String signature)
Description copied from interface: FeatureSet
Finds the feature that has the specified type and signature

getSortedFeatures

public Feature[] getSortedFeatures()
Description copied from interface: FeatureSet
Returns features sorted according to their DisplayProperty's preferences.
Tags copied from interface: FeatureSet
See Also:
DisplayProperties

isEmpty

public boolean isEmpty()
Description copied from interface: FeatureSet
This method exists for optimization purposes. Some FeatureSets will be able to answer this question without actually building a set of features.

activate

protected void activate()
Description copied from class: AbstractResourceListener
Registers this object as an observer on all registered resource adapters and resource set adapters, then it calls invalidate() on self to restart the resource parsing process.
Overrides:
activate in class AbstractResourceListener
Tags copied from class: AbstractResourceListener
See Also:
AbstractFeature.addPropertyChangeListener(PropertyChangeListener), AbstractFeatureSet.addFeatureSetListener(FeatureSetListener)

passivate

protected void passivate()
Description copied from class: AbstractResourceListener
Unregisters this object as an observer from all registered resource adapters and resource set adapters.
Overrides:
passivate in class AbstractResourceListener
Tags copied from class: AbstractResourceListener
See Also:
AbstractFeature.removePropertyChangeListener(PropertyChangeListener), AbstractFeatureSet.removeFeatureSetListener(FeatureSetListener)

release

public void release()
Description copied from interface: FeatureSet
This method is called when the parent feature is removed from the feature tree. The set should unregister itself from everything it was listening to and forward the message to all child features.
Overrides:
release in class AbstractResourceListener

getFeatureConstructors

public com.sun.java.util.collections.Set getFeatureConstructors()
Description copied from interface: FeatureSet
Returns a set of FeatureConstructor objects suitable for the use in the context of this feature set's parent.

getPrimitiveFeatureConstructors

protected com.sun.java.util.collections.Set getPrimitiveFeatureConstructors(java.lang.String type)
Description copied from class: AbstractFeatureSet
Returns a set of basic feature constructors which can be used to build features of the specified type. Other, non-primitive, constructors will have to be coded in terms of other constructors, they cannot produce features directly. The non-primitive constructors are produced by FeatureConstructorFactories.
Overrides:
getPrimitiveFeatureConstructors in class AbstractFeatureSet

featureAdded

public void featureAdded(FeatureSet set,
                         Feature feature)
Specified by:
featureAdded in interface FeatureSetListener

featureRemoved

public void featureRemoved(FeatureSet set,
                           Feature feature)
Specified by:
featureRemoved in interface FeatureSetListener

featureReplaced

public void featureReplaced(FeatureSet set,
                            Feature oldFeature,
                            Feature newFeature)
Specified by:
featureReplaced in interface FeatureSetListener