org.biojava.bio.seq
Class FeatureFilter.StrandFilter

java.lang.Object
  extended by org.biojava.bio.seq.FeatureFilter.StrandFilter
All Implemented Interfaces:
Serializable, FeatureFilter, OptimizableFilter
Enclosing interface:
FeatureFilter

public static final class FeatureFilter.StrandFilter
extends Object
implements OptimizableFilter

Accept features with a given strandedness.

Since:
1.1
Author:
Matthew Pocock
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureFilter
FeatureFilter.And, FeatureFilter.AnnotationContains, FeatureFilter.ByAncestor, FeatureFilter.ByAnnotation, FeatureFilter.ByAnnotationType, FeatureFilter.ByChild, FeatureFilter.ByClass, FeatureFilter.ByComponentName, FeatureFilter.ByDescendant, FeatureFilter.ByFeature, FeatureFilter.ByPairwiseScore, FeatureFilter.ByParent, FeatureFilter.BySequenceName, FeatureFilter.BySource, FeatureFilter.ByType, FeatureFilter.ContainedByLocation, FeatureFilter.FrameFilter, FeatureFilter.HasAnnotation, FeatureFilter.Not, FeatureFilter.OnlyChildren, FeatureFilter.OnlyDescendants, FeatureFilter.Or, FeatureFilter.OverlapsLocation, FeatureFilter.ShadowContainedByLocation, FeatureFilter.ShadowOverlapsLocation, FeatureFilter.StrandFilter
 
Field Summary
 
Fields inherited from interface org.biojava.bio.seq.FeatureFilter
all, leaf, none, top_level
 
Constructor Summary
FeatureFilter.StrandFilter(StrandedFeature.Strand strand)
          Build a new filter that matches all features of a given strand.
 
Method Summary
 boolean accept(Feature f)
          Accept the Feature if it is an instance of StrandedFeature and matches the value of getStrand().
 boolean equals(Object o)
           
 StrandedFeature.Strand getStrand()
          Retrieve the strand this matches.
 int hashCode()
           
 boolean isDisjoint(FeatureFilter filt)
          Returns true if this filter is disjoint from filt - that is, there is no Feature that is accepted by both filters.
 boolean isProperSubset(FeatureFilter sup)
          Returns true if this filter is a proper subset of sup - that is, for every feature that matches this, it also matches sup.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureFilter.StrandFilter

public FeatureFilter.StrandFilter(StrandedFeature.Strand strand)
Build a new filter that matches all features of a given strand.

Parameters:
strand - the Strand to match
Method Detail

getStrand

public StrandedFeature.Strand getStrand()
Retrieve the strand this matches.

Returns:
the Strand matched

accept

public boolean accept(Feature f)
Accept the Feature if it is an instance of StrandedFeature and matches the value of getStrand().

Specified by:
accept in interface FeatureFilter
Parameters:
f - the Feature to check
Returns:
true if the strand matches, or false otherwise

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isProperSubset

public boolean isProperSubset(FeatureFilter sup)
Description copied from interface: OptimizableFilter
Returns true if this filter is a proper subset of sup - that is, for every feature that matches this, it also matches sup. The empty filter is a proper subset of all filters. All filters are a proper subset of the all filter. All filters are proper subsets of themselves.

Specified by:
isProperSubset in interface OptimizableFilter
Parameters:
sup - the potential super set
Returns:
true if sup contains all features contained by this filter

isDisjoint

public boolean isDisjoint(FeatureFilter filt)
Description copied from interface: OptimizableFilter
Returns true if this filter is disjoint from filt - that is, there is no Feature that is accepted by both filters. The empty filter is disjoint from all other filters. The all filter is disjoint from none.

Specified by:
isDisjoint in interface OptimizableFilter