Package org.biojavax
Class SimpleRankedCrossRef
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.SimpleRankedCrossRef
-
- All Implemented Interfaces:
Comparable
,Changeable
,RankedCrossRef
public class SimpleRankedCrossRef extends AbstractChangeable implements RankedCrossRef
Simple implementation of RankedCrossRef.- Since:
- 1.5
- Author:
- Richard Holland, gwaldon
-
-
Field Summary
-
Fields inherited from interface org.biojavax.RankedCrossRef
RANK
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleRankedCrossRef()
SimpleRankedCrossRef(CrossRef crossref, int rank)
Constructs a new crossref with a rank.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Ranked cross references are sorted first by rank, then by cross reference.boolean
equals(Object obj)
Ranked cross references are the same if they have the same rank and refer to the same cross reference (cross references are equal).CrossRef
getCrossRef()
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.String
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 Detail
-
SimpleRankedCrossRef
public SimpleRankedCrossRef(CrossRef crossref, int rank)
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 Detail
-
getCrossRef
public CrossRef getCrossRef()
Return the cross reference associated with this object.- Specified by:
getCrossRef
in interfaceRankedCrossRef
- Returns:
- a crossref object.
-
setRank
public void setRank(int rank) throws ChangeVetoException
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
public int getRank()
Return the rank associated with the cross reference.- Specified by:
getRank
in interfaceRankedCrossRef
- Returns:
- the rank.
-
equals
public boolean equals(Object obj)
Ranked cross references are the same if they have the same rank and refer to the same cross reference (cross references are equal).
-
compareTo
public int compareTo(Object o)
Ranked cross references are sorted first by rank, then by cross reference.- Specified by:
compareTo
in interfaceComparable
-
-