Package org.biojavax
Class SimpleRankedCrossRef
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.SimpleRankedCrossRef
- All Implemented Interfaces:
Comparable
,Changeable
,RankedCrossRef
Simple implementation of RankedCrossRef.
- Since:
- 1.5
- Author:
- Richard Holland, gwaldon
-
Field Summary
Fields inherited from interface org.biojavax.RankedCrossRef
RANK
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleRankedCrossRef
(CrossRef crossref, int rank) Constructs a new crossref with a rank. -
Method Summary
Modifier and TypeMethodDescriptionint
Ranked cross references are sorted first by rank, then by cross reference.boolean
Ranked cross references are the same if they have the same rank and refer to the same cross reference (cross references are equal).Return the cross reference associated with this object.int
getRank()
Return the rank associated with the cross reference.int
hashCode()
void
setRank
(int rank) Set the rank associated with the cross reference.toString()
Form: "(#rank) crossref"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 Details
-
SimpleRankedCrossRef
Constructs a new crossref with a rank.- Parameters:
crossref
- the crossref to rank. Must not be null.rank
- the rank to give it.
-
SimpleRankedCrossRef
protected SimpleRankedCrossRef()
-
-
Method Details
-
getCrossRef
Return the cross reference associated with this object.- Specified by:
getCrossRef
in interfaceRankedCrossRef
- Returns:
- a crossref object.
-
setRank
Set the rank associated with the cross reference.- Specified by:
setRank
in interfaceRankedCrossRef
- Parameters:
rank
- the rank to use.- Throws:
ChangeVetoException
- if the new rank is unacceptable.
-
getRank
Return the rank associated with the cross reference.- Specified by:
getRank
in interfaceRankedCrossRef
- Returns:
- the rank.
-
equals
Ranked cross references are the same if they have the same rank and refer to the same cross reference (cross references are equal). -
compareTo
Ranked cross references are sorted first by rank, then by cross reference.- Specified by:
compareTo
in interfaceComparable
-
hashCode
-
toString
Form: "(#rank) crossref"
-