Package org.biojava.bio.seq
Class AbstractFeatureHolder
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.seq.AbstractFeatureHolder
-
- All Implemented Interfaces:
FeatureHolder
,Changeable
- Direct Known Subclasses:
MergeFeatureHolder
,ProjectedFeatureHolder
,SimpleFeatureHolder
public abstract class AbstractFeatureHolder extends AbstractChangeable implements FeatureHolder
An abstract implementation of FeatureHolder. This provides the filter method, but who wants to code that more than once? It also has support for the ChangeEvents.- Author:
- Matthew Pocock, Thomas Down
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureHolder
FeatureHolder.EmptyFeatureHolder
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.seq.FeatureHolder
EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA
-
-
Constructor Summary
Constructors Constructor Description AbstractFeatureHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Feature
createFeature(Feature.Template temp)
Create a new Feature, and add it to this FeatureHolder.FeatureHolder
filter(FeatureFilter filter)
Query this set of features using a suppliedFeatureFilter
.FeatureHolder
filter(FeatureFilter ff, boolean recurse)
Return a new FeatureHolder that contains all of the children of this one that passed the filter fc.void
removeFeature(Feature f)
Remove a feature from this FeatureHolder.-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from interface org.biojava.bio.seq.FeatureHolder
containsFeature, countFeatures, features, getSchema
-
-
-
-
Constructor Detail
-
AbstractFeatureHolder
public AbstractFeatureHolder()
-
-
Method Detail
-
filter
public FeatureHolder filter(FeatureFilter filter)
Description copied from interface:FeatureHolder
Query this set of features using a suppliedFeatureFilter
.- Specified by:
filter
in interfaceFeatureHolder
- Parameters:
filter
- theFeatureFilter
to apply.- Returns:
- all features in this container which match
filter
.
-
filter
public FeatureHolder filter(FeatureFilter ff, boolean recurse)
Description copied from interface:FeatureHolder
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.- Specified by:
filter
in interfaceFeatureHolder
- Parameters:
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.
-
createFeature
public Feature createFeature(Feature.Template temp) throws BioException, ChangeVetoException
Description copied from interface:FeatureHolder
Create 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.- Specified by:
createFeature
in interfaceFeatureHolder
- Throws:
BioException
- if something went wrong during creating the featureChangeVetoException
- if this FeatureHolder does not support creation of new features, or if the change was vetoed
-
removeFeature
public void removeFeature(Feature f) throws ChangeVetoException, BioException
Description copied from interface:FeatureHolder
Remove a feature from this FeatureHolder.- Specified by:
removeFeature
in interfaceFeatureHolder
- Throws:
ChangeVetoException
- if this FeatureHolder does not support feature removal or if the change was vetoedBioException
- if there was an error removing the feature
-
-