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
ConstructorsModifierConstructorDescriptionprotectedSimpleRichFeatureRelationship(RichFeature object, RichFeature subject, ComparableTerm term, int rank) Creates a new instance of SimpleRichFeatureRelationship. -
Method Summary
Modifier and TypeMethodDescriptionintRelations are compared first by rank, then object, subject, then finally term.booleanRelations are equal if their objects, subjects and terms are equal.static ComparableTermGets the default CONTAINS term used for defining the relationship between features.getId()Gets the Hibernate ID.Returns the object of this relationship (ie. the feature which this relationship starts from).intgetRank()Gets the rank of this relationship.Gets the feature that this relationship refers to.getTerm()Gets the term that describes this relationship.inthashCode()voidSets the Hibernate ID.voidsetRank(int rank) Sets the rank of this relationship.toString()Form: "(#rank) term(object,subject)"Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
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 Details
-
getContainsTerm
Gets the default CONTAINS term used for defining the relationship between features.- Returns:
- the default CONTAINS term.
-
setRank
Sets the rank of this relationship.- Specified by:
setRankin interfaceRichFeatureRelationship- Parameters:
rank- Value of property rank.- Throws:
ChangeVetoException- if the rank is untasty.
-
getRank
Gets the rank of this relationship.- Specified by:
getRankin interfaceRichFeatureRelationship- Returns:
- Value of property rank.
-
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:
getObjectin interfaceRichFeatureRelationship- Returns:
- Value of property object.
-
getSubject
Gets the feature that this relationship refers to. This is set at constructor time and is immutable.- Specified by:
getSubjectin interfaceRichFeatureRelationship- Returns:
- Value of property subject.
-
getTerm
Gets the term that describes this relationship. This is set at constructor time and is immutable.- Specified by:
getTermin interfaceRichFeatureRelationship- Returns:
- Value of property term.
-
compareTo
Relations are compared first by rank, then object, subject, then finally term.- Specified by:
compareToin interfaceComparable
-
equals
Relations are equal if their objects, subjects and terms are equal. -
hashCode
-
toString
Form: "(#rank) term(object,subject)" -
getId
Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
-
setId
Sets the Hibernate ID. Should be used with caution.- Parameters:
id- the Hibernate ID, if using Hibernate.
-