Package org.biojavax.bio.seq
Class SimpleRichFeatureRelationship
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.bio.seq.SimpleRichFeatureRelationship
-
- All Implemented Interfaces:
Comparable
,Changeable
,RichFeatureRelationship
public class SimpleRichFeatureRelationship extends AbstractChangeable implements RichFeatureRelationship
Represents a relationship between two features that is described by a term.- Since:
- 1.5
- Author:
- Richard Holland, Mark Schreiber
-
-
Field Summary
-
Fields inherited from interface org.biojavax.bio.seq.RichFeatureRelationship
RANK
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleRichFeatureRelationship()
SimpleRichFeatureRelationship(RichFeature object, RichFeature subject, ComparableTerm term, int rank)
Creates a new instance of SimpleRichFeatureRelationship.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Relations are compared first by rank, then object, subject, then finally term.boolean
equals(Object obj)
Relations are equal if their objects, subjects and terms are equal.static ComparableTerm
getContainsTerm()
Gets the default CONTAINS term used for defining the relationship between features.Integer
getId()
Gets the Hibernate ID.RichFeature
getObject()
Returns the object of this relationship (ie. the feature which this relationship starts from).int
getRank()
Gets the rank of this relationship.RichFeature
getSubject()
Gets the feature that this relationship refers to.ComparableTerm
getTerm()
Gets the term that describes this relationship.int
hashCode()
void
setId(Integer id)
Sets the Hibernate ID.void
setRank(int rank)
Sets the rank of this relationship.String
toString()
Form: "(#rank) term(object,subject)"-
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
-
-
-
-
Constructor Detail
-
SimpleRichFeatureRelationship
public SimpleRichFeatureRelationship(RichFeature object, RichFeature subject, ComparableTerm term, int rank)
Creates a new instance of SimpleRichFeatureRelationship.- Parameters:
subject
- The subject RichFeature.term
- The relationship term.rank
- the rank of the relationship.
-
SimpleRichFeatureRelationship
protected SimpleRichFeatureRelationship()
-
-
Method Detail
-
getContainsTerm
public static ComparableTerm getContainsTerm()
Gets the default CONTAINS term used for defining the relationship between features.- Returns:
- the default CONTAINS term.
-
setRank
public void setRank(int rank) throws ChangeVetoException
Sets the rank of this relationship.- Specified by:
setRank
in interfaceRichFeatureRelationship
- Parameters:
rank
- Value of property rank.- Throws:
ChangeVetoException
- if the rank is untasty.
-
getRank
public int getRank()
Gets the rank of this relationship.- Specified by:
getRank
in interfaceRichFeatureRelationship
- Returns:
- Value of property rank.
-
getObject
public RichFeature getObject()
Returns the object of this relationship (ie. the feature which this relationship starts from). This is an immutable property set by the constructor of an instantiating class.- Specified by:
getObject
in interfaceRichFeatureRelationship
- Returns:
- Value of property object.
-
getSubject
public RichFeature getSubject()
Gets the feature that this relationship refers to. This is set at constructor time and is immutable.- Specified by:
getSubject
in interfaceRichFeatureRelationship
- Returns:
- Value of property subject.
-
getTerm
public ComparableTerm getTerm()
Gets the term that describes this relationship. This is set at constructor time and is immutable.- Specified by:
getTerm
in interfaceRichFeatureRelationship
- Returns:
- Value of property term.
-
compareTo
public int compareTo(Object o)
Relations are compared first by rank, then object, subject, then finally term.- Specified by:
compareTo
in interfaceComparable
-
equals
public boolean equals(Object obj)
Relations are equal if their objects, subjects and terms are equal.
-
getId
public Integer getId()
Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
-
-