- All Superinterfaces:
- All Known Subinterfaces:
- All Known Implementing Classes:
public interface FeatureHolder extends ChangeableThe interface for objects that contain features.
Feature holders abstract the containment of a feature from the objects that implements both the real container or the features. FeatureHolders are like sets of features.
- Matthew Pocock, Thomas Down
- See Also:
Nested Class Summary
Nested Classes Modifier and Type Interface Description
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
containsFeature(Feature f)Check if the feature is present in this holder.
countFeatures()Count how many features are contained.
createFeature(Feature.Template ft)Create a new Feature, and add it to this FeatureHolder.
features()Iterate over the features in no well defined order.
filter(FeatureFilter filter)Query this set of features using a supplied
filter(FeatureFilter fc, boolean recurse)Return a new FeatureHolder that contains all of the children of this one that passed the filter fc.
getSchema()Return a schema-filter for this
removeFeature(Feature f)Remove a feature from this FeatureHolder.
static final ChangeType FEATURESSignals that features have been added or removed directly within this FeatureHolder.
static final ChangeType SCHEMASignals that the schema of this FeatureHolder has changed.
int countFeatures()Count how many features are contained.
- a positive integer or zero, equal to the number of features contained
featuresIterate over the features in no well defined order.
- an Iterator
FeatureHolder filter(FeatureFilter fc, boolean recurse)Return a new FeatureHolder that contains all of the children of this one that passed the filter fc. This method is scheduled for deprecation. Use the 1-arg filter instead.
fc- the FeatureFilter to apply
recurse- true if all features-of-features should be scanned, and a single flat collection of features returned, or false if just immediate children should be filtered.
FeatureHolder filter(FeatureFilter filter)Query this set of features using a supplied
- all features in this container which match
Feature createFeature(Feature.Template ft) throws BioException, ChangeVetoExceptionCreate a new Feature, and add it to this FeatureHolder. This method will generally only work on Sequences, and on some Features which have been attached to Sequences.
void removeFeature(Feature f) throws ChangeVetoException, BioExceptionRemove a feature from this FeatureHolder.
boolean containsFeature(Feature f)Check if the feature is present in this holder.
f- the Feature to check
- true if f is in this set
getSchemaReturn a schema-filter for this
FeatureHolder. This is a filter which all
Features immediately contained by this
FeatureHolderwill match. It need not directly match their child features, but it can (and should!) provide information about them using
FeatureFilter.OnlyChildrenfilters. In cases where there is no feature hierarchy, this can be indicated by including
FeatureFilter.leafin the schema filter.
For the truly non-informative case, it is possible to return
FeatureFilter.all. However, it is almost always possible to provide slightly more information that this. For example,
Sequenceobjects should, at a minimum, return
Featureobjects should, as a minimum, return
- the schema filter