|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojavax.bio.seq.SimpleRichFeature
public class SimpleRichFeature
A simple implementation of RichFeature.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojavax.bio.seq.RichFeature |
|---|
RichFeature.Template, RichFeature.Tools |
| Nested classes/interfaces inherited from interface org.biojava.bio.seq.StrandedFeature |
|---|
StrandedFeature.Strand |
| Nested classes/interfaces inherited from interface org.biojava.bio.seq.Feature |
|---|
Feature.ByLocationComparator |
| Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureHolder |
|---|
FeatureHolder.EmptyFeatureHolder |
| Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable |
|---|
Annotatable.AnnotationForwarder |
| Field Summary |
|---|
| Fields inherited from interface org.biojavax.bio.seq.RichFeature |
|---|
CROSSREF, LOCATION, NAME, PARENT, RANK, RELATION, SOURCETERM, TYPETERM |
| Fields inherited from interface org.biojava.bio.seq.StrandedFeature |
|---|
NEGATIVE, POSITIVE, STRAND, UNKNOWN |
| Fields inherited from interface org.biojava.bio.seq.Feature |
|---|
byLocationOrder, PROPERTY_DATA_KEY, SOURCE, TYPE |
| Fields inherited from interface org.biojava.bio.seq.FeatureHolder |
|---|
EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA |
| Fields inherited from interface org.biojava.bio.Annotatable |
|---|
ANNOTATION |
| Constructor Summary | |
|---|---|
protected |
SimpleRichFeature()
|
|
SimpleRichFeature(FeatureHolder parent,
Feature.Template templ)
Creates a new instance of SimpleRichFeature based on a template. |
| Method Summary | |
|---|---|
void |
addFeatureRelationship(RichFeatureRelationship relationship)
Adds a relationship to this feature holder. |
void |
addRankedCrossRef(RankedCrossRef crossref)
Adds a ranked cross reference to the existing set. |
int |
compareTo(Object o)
Features are sorted by rank only. |
boolean |
containsFeature(Feature f)
Check if the feature is present in this holder. |
int |
countFeatures()
Count how many features are contained. |
Feature |
createFeature(Feature.Template ft)
Create a new Feature, and add it to this FeatureHolder. |
boolean |
equals(Object o)
Features are equal when they have the same parent, type, source and rank. |
Iterator |
features()
Iterate over any child features which are held by this feature. |
FeatureHolder |
filter(FeatureFilter filter)
Query this set of features using a supplied FeatureFilter. |
FeatureHolder |
filter(FeatureFilter fc,
boolean recurse)
Return a new FeatureHolder that contains all of the children of this one that passed the filter fc. |
Annotation |
getAnnotation()
Should return the associated annotation object. |
Set |
getFeatureRelationshipSet()
Returns the set of relationships held in this feature holder. Warning this method gives access to the original Collection not a copy. |
Location |
getLocation()
The location of this feature. |
String |
getName()
Returns the name of this feature. |
Set |
getNoteSet()
Returns the set of notes associated with this object. Warning this method gives access to the original Collection not a copy. |
FeatureHolder |
getParent()
Return the FeatureHolder to which this feature has been
attached. |
int |
getRank()
Returns the rank of this feature. |
Set |
getRankedCrossRefs()
Returns the set of all ranked cross references associated with an object. Warning this method gives access to the original Collection not a copy. |
FeatureFilter |
getSchema()
Return a schema-filter for this FeatureHolder. |
Sequence |
getSequence()
Return the Sequence object to which this feature
is (ultimately) attached. |
String |
getSource()
The source of the feature. |
Term |
getSourceTerm()
An ontology term defining the source of this feature. |
StrandedFeature.Strand |
getStrand()
Retrieve the strand that this feature lies upon. |
SymbolList |
getSymbols()
Return a list of symbols that are contained in this feature. |
String |
getType()
The type of the feature. |
Term |
getTypeTerm()
An ontology term defining the type of feature. |
int |
hashCode()
|
Feature.Template |
makeTemplate()
Create a new Template that could be used to generate a feature identical to this one. |
void |
removeFeature(Feature f)
Remove a feature from this FeatureHolder. |
void |
removeFeatureRelationship(RichFeatureRelationship relationship)
Removes a relationship from this feature holder. |
void |
removeRankedCrossRef(RankedCrossRef crossref)
Removes a ranked cross reference from the existing set. |
void |
setFeatureRelationshipSet(Set relationships)
Clears the relations from this feautre holder and replaces them with a new set. Warning this method gives access to the original Collection not a copy. |
void |
setLocation(Location loc)
The new location for this feature. |
void |
setName(String name)
Sets the name of this feature. |
void |
setNoteSet(Set notes)
Clears the notes associated with this object and replaces them with the contents of this set. Warning this method gives access to the original Collection not a copy. |
void |
setParent(FeatureHolder parent)
Sets the parent of this feature. |
void |
setRank(int rank)
Sets the rank of this feature. |
void |
setRankedCrossRefs(Set crossrefs)
Sets the ranked cross references associated with an object. Warning this method gives access to the original Collection not a copy. |
void |
setSource(String source)
Change the source of the Feature. |
void |
setSourceTerm(Term t)
Set the source ontology-term for this feature. |
void |
setStrand(StrandedFeature.Strand strand)
Set the strand that this feature lies upon. NOT IMPLEMENTED. |
void |
setType(String type)
Change the type of this feature. |
void |
setTypeTerm(Term t)
Set the type ontology-term for this feature. |
String |
toString()
Form: "(#rank) parent:type,source(location)" |
| 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, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
|---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Methods inherited from interface org.biojava.utils.Changeable |
|---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Constructor Detail |
|---|
public SimpleRichFeature(FeatureHolder parent,
Feature.Template templ)
throws ChangeVetoException,
InvalidTermException
parent - The parent feature holder.templ - The template to construct the feature from.
ChangeVetoException - if we don't want to be like the template.
InvalidTermException - if any of the template terms are bad.protected SimpleRichFeature()
| Method Detail |
|---|
public Feature.Template makeTemplate()
makeTemplate in interface Featurepublic Annotation getAnnotation()
getAnnotation in interface Annotatablepublic Set getNoteSet()
getNoteSet in interface RichAnnotatableNote
public void setNoteSet(Set notes)
throws ChangeVetoException
setNoteSet in interface RichAnnotatablenotes - the set of Note objects to replace the existing ones with.
ChangeVetoException - if the set is null or contains any objects
that are not Note objects.Note
public void setName(String name)
throws ChangeVetoException
setName in interface RichFeaturename - the name the feature should identify itself with.
ChangeVetoException - if the new value is unacceptable.public String getName()
getName in interface RichFeature
public void setRank(int rank)
throws ChangeVetoException
setRank in interface RichFeaturerank - the rank the feature should identify itself with.
ChangeVetoException - if the new value is unacceptable.public int getRank()
getRank in interface RichFeaturepublic Sequence getSequence()
Sequence object to which this feature
is (ultimately) attached. For top level features, this will be
equal to the FeatureHolder returned by
getParent.
getSequence in interface Featurepublic String getSource()
getSource in interface Feature
public void setSource(String source)
throws ChangeVetoException
setSource in interface Featuresource - the new source String
ChangeVetoException - if the source can't be alteredpublic Term getSourceTerm()
OntoTools.ANY
in implementations which aren't ontology aware.
getSourceTerm in interface Feature
public void setSourceTerm(Term t)
throws ChangeVetoException,
InvalidTermException
setSourceTerm in interface FeatureChangeVetoException - if changes are not allowed
InvalidTermException - if the specified term is not an acceptable type
for this feature.public String getType()
getType in interface Feature
public void setType(String type)
throws ChangeVetoException
setType in interface Featuretype - new type String
ChangeVetoException - if the type can't be alteredpublic Term getTypeTerm()
OntoTools.ANY
in implementations which aren't ontology aware.
getTypeTerm in interface Feature
public void setTypeTerm(Term t)
throws ChangeVetoException,
InvalidTermException
setTypeTerm in interface FeatureChangeVetoException - if changes are not allowed
InvalidTermException - if the specified term is not an acceptable type
for this feature.public SymbolList getSymbols()
The symbols may not be contiguous in the original sequence, but they will be concatenated together in the resulting SymbolList.
The order of the Symbols within the resulting symbol list will be according to the concept of ordering within the location object.
If the feature location is modified then this does not modify any SymbolList produced by earlier invocations of this method.
getSymbols in interface FeaturegetSymbols in interface StrandedFeaturepublic Location getLocation()
The location may be complicated, or simply a range. The annotation is assumed to apply to all the region contained within the location.
getLocation in interface Feature
public void setLocation(Location loc)
throws ChangeVetoException
The location may be complicated or simply a range. The annotation is assumed to apply to the entire region contained within the location. Any values returned from methods that rely on the old location must not be affected.
setLocation in interface Featureloc - the new Location for this feature
ChangeVetoException - if the location can't be alteredpublic FeatureHolder getParent()
FeatureHolder to which this feature has been
attached. This will be a Sequence object for top level
features, and a Feature object for features further
down the tree.
getParent in interface Feature
public void setParent(FeatureHolder parent)
throws ChangeVetoException
setParent in interface RichFeatureparent - the parent the feature should identify itself with.
ChangeVetoException - if the new value is unacceptable.public Set getRankedCrossRefs()
getRankedCrossRefs in interface RankedCrossRefable
public void setRankedCrossRefs(Set crossrefs)
throws ChangeVetoException
setRankedCrossRefs in interface RankedCrossRefablecrossrefs - a set of RankedCrossRef objects.
ChangeVetoException - if the set was null or any of its contents
were not RankedCrossRef objects.
public void addRankedCrossRef(RankedCrossRef crossref)
throws ChangeVetoException
addRankedCrossRef in interface RankedCrossRefablecrossref - the ranked cross reference to add.
ChangeVetoException - if the parameter is null.
public void removeRankedCrossRef(RankedCrossRef crossref)
throws ChangeVetoException
removeRankedCrossRef in interface RankedCrossRefablecrossref - the ranked cross reference to remove.
ChangeVetoException - if the parameter is null.public Set getFeatureRelationshipSet()
getFeatureRelationshipSet in interface RichFeatureHolder
public void setFeatureRelationshipSet(Set relationships)
throws ChangeVetoException
setFeatureRelationshipSet in interface RichFeatureHolderrelationships - the new set of features this holder should have. The set must
contain only RichFeatureRelationship objects.
ChangeVetoException - if the new set could not be installed.
public void addFeatureRelationship(RichFeatureRelationship relationship)
throws ChangeVetoException
addFeatureRelationship in interface RichFeatureHolderrelationship - the relationship to add.
ChangeVetoException - if the relationship is unacceptable.
public void removeFeatureRelationship(RichFeatureRelationship relationship)
throws ChangeVetoException
removeFeatureRelationship in interface RichFeatureHolderrelationship - the relationship to remove.
ChangeVetoException - if it cannot be removed.public boolean containsFeature(Feature f)
containsFeature in interface FeatureHolderf - the Feature to check
public int countFeatures()
countFeatures in interface FeatureHolder
public Feature createFeature(Feature.Template ft)
throws BioException,
ChangeVetoException
createFeature in interface FeatureHolderBioException - if something went wrong during creating the feature
ChangeVetoException - if this FeatureHolder does not support
creation of new features, or if the change was vetoedpublic Iterator features()
features in interface Featurefeatures in interface FeatureHolderpublic FeatureHolder filter(FeatureFilter filter)
FeatureFilter.
filter in interface FeatureHolderfilter - the FeatureFilter to apply.
filter.
public FeatureHolder filter(FeatureFilter fc,
boolean recurse)
filter in interface FeatureHolderfc - 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. This is a filter
which all Features 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
public void removeFeature(Feature f)
throws ChangeVetoException,
BioException
removeFeature in interface FeatureHolderChangeVetoException - if this FeatureHolder does not support
feature removal or if the change was vetoed
BioException - if there was an error removing the feature
public void setStrand(StrandedFeature.Strand strand)
throws ChangeVetoException
This will be one of StrandedFeature.POSITIVE or NEGATIVE. NOT IMPLEMENTED.
setStrand in interface StrandedFeaturestrand - a Strand.
ChangeVetoException - if the strand may not be
changed.public StrandedFeature.Strand getStrand()
This will be one of StrandedFeature.POSITIVE or NEGATIVE.
getStrand in interface StrandedFeaturepublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int compareTo(Object o)
compareTo in interface Comparablepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||