public class MergeFeatureHolder extends AbstractFeatureHolder implements Serializable
RichFeatureRelationshipHolder
,
Serialized FormFeatureHolder.EmptyFeatureHolder
EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA
Constructor and Description |
---|
MergeFeatureHolder()
Create a new, empty, MergeFeatureHolder.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeatureHolder(FeatureHolder fh)
Add an extra FeatureHolder to the set of FeatureHolders which
are merged.
|
boolean |
containsFeature(Feature f)
Check if the feature is present in this holder.
|
int |
countFeatures()
Count how many features are contained.
|
Iterator |
features()
Iterate over all the features in all child FeatureHolders.
|
FeatureHolder |
filter(FeatureFilter ff,
boolean recurse)
When applied to a MergeFeatureHolder, this filters each child
FeatureHolder independently.
|
FeatureFilter |
getSchema()
Return a schema-filter for this
FeatureHolder . |
void |
removeFeatureHolder(FeatureHolder fh)
Remove a FeatureHolder from the set of FeatureHolders which
are merged.
|
createFeature, filter, removeFeature
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public MergeFeatureHolder()
public void addFeatureHolder(FeatureHolder fh) throws ChangeVetoException
mfh.addFeatureHolder(fh, FeatureFilter.all);
You should always use the two-arg version in preference if you are able to define the membership of a FeatureHolder.
ChangeVetoException
public void removeFeatureHolder(FeatureHolder fh) throws ChangeVetoException
ChangeVetoException
public int countFeatures()
FeatureHolder
countFeatures
in interface FeatureHolder
public boolean containsFeature(Feature f)
FeatureHolder
containsFeature
in interface FeatureHolder
f
- the Feature to checkpublic Iterator features()
features
in interface FeatureHolder
public FeatureHolder filter(FeatureFilter ff, boolean recurse)
filter
in interface FeatureHolder
filter
in class AbstractFeatureHolder
ff
- the FeatureFilter to applyrecurse
- 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.public FeatureFilter getSchema()
FeatureHolder
FeatureHolder
. This is a filter
which all Feature
s immediately contained by this FeatureHolder
will match. It need not directly match their child features, but it can (and should!) provide
information about them using FeatureFilter.OnlyChildren
filters. In cases where there
is no feature hierarchy, this can be indicated by including FeatureFilter.leaf
in
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, Sequence
objects should, at a minimum, return FeatureFilter.top_level
. Feature
objects
should, as a minimum, return FeatureFilter.ByParent(new FeatureFilter.ByFeature(this))
.
getSchema
in interface FeatureHolder
Copyright © 2014 BioJava. All rights reserved.