org.biojava.bio.seq
Class AbstractFeatureHolder

java.lang.Object
  |
  +--org.biojava.bio.seq.AbstractFeatureHolder
Direct Known Subclasses:
MergeFeatureHolder, SimpleFeatureHolder

public abstract class AbstractFeatureHolder
extends java.lang.Object
implements FeatureHolder

An abstract implementation of FeatureHolder. This only provides the filter method, but who wants to code that more than once?

Author:
Matthew Pocock

Inner classes inherited from class org.biojava.bio.seq.FeatureHolder
FeatureHolder.EmptyFeatureHolder
 
Fields inherited from interface org.biojava.bio.seq.FeatureHolder
EMPTY_FEATURE_HOLDER
 
Constructor Summary
AbstractFeatureHolder()
           
 
Method Summary
 Feature createFeature(Feature.Template temp)
          Create a new Feature, and add it to this FeatureHolder.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFeatureHolder

public AbstractFeatureHolder()
Method Detail

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.
Specified by:
filter in interface FeatureHolder
Tags copied from interface: FeatureHolder
Parameters:
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.

createFeature

public Feature createFeature(Feature.Template temp)
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 interface FeatureHolder
Tags copied from interface: FeatureHolder
Throws:
java.lang.UnsupportedOperationException - if this FeatureHolder does not support addition of new features.

removeFeature

public void removeFeature(Feature f)
Description copied from interface: FeatureHolder
Remove a feature from this FeatureHolder.
Specified by:
removeFeature in interface FeatureHolder
Tags copied from interface: FeatureHolder
Throws:
java.lang.UnsupportedOperationException - if this FeatureHolder does not support feature removal.