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
ConstructorsModifierConstructorDescriptionprotectedSimpleRankedCrossRef(CrossRef crossref, int rank) Constructs a new crossref with a rank. -
Method Summary
Modifier and TypeMethodDescriptionintRanked cross references are sorted first by rank, then by cross reference.booleanRanked 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.intgetRank()Return the rank associated with the cross reference.inthashCode()voidsetRank(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, 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
-
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:
getCrossRefin interfaceRankedCrossRef- Returns:
- a crossref object.
-
setRank
Set the rank associated with the cross reference.- Specified by:
setRankin 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:
getRankin 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:
compareToin interfaceComparable
-
hashCode
-
toString
Form: "(#rank) crossref"
-