|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojavax.SimpleRankedDocRef
public class SimpleRankedDocRef
Represents a documentary reference.
Field Summary |
---|
Fields inherited from interface org.biojavax.RankedDocRef |
---|
LOCATION, RANK |
Constructor Summary | |
---|---|
protected |
SimpleRankedDocRef()
|
|
SimpleRankedDocRef(DocRef docref,
Integer start,
Integer end,
int rank)
Constructs a new docref for a given location. |
|
SimpleRankedDocRef(DocRef docref,
RichLocation location,
int rank)
Constructs a new docref for a given location. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Ranked document references are sorted first by rank then location then by actual document reference. |
boolean |
equals(Object obj)
Two ranked document references are equal if they have the same rank and refer to the same location and same document reference. |
DocRef |
getDocumentReference()
Represents a reference to a document. |
Integer |
getEnd()
The end position in the sequence that this reference is referred to from. |
RichLocation |
getLocation()
If this object was constructed using a location instead of two integers, then this method will return that location. |
int |
getRank()
The rank of this reference. |
Integer |
getStart()
The start position in the sequence that this reference is referred to from. |
int |
hashCode()
|
void |
setLocation(RichLocation location)
Set the location of this reference. |
void |
setRank(int rank)
Set the rank of this reference. |
String |
toString()
Form: "(#rank) docref" |
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 |
---|
public SimpleRankedDocRef(DocRef docref, Integer start, Integer end, int rank)
docref
- the document reference. Must not be null.start
- the start position of the location.end
- the end position of the location.public SimpleRankedDocRef(DocRef docref, RichLocation location, int rank)
docref
- the document reference. Must not be null.location
- the position of the document reference. Must not be null.protected SimpleRankedDocRef()
Method Detail |
---|
public void setRank(int rank) throws ChangeVetoException
setRank
in interface RankedDocRef
rank
- the rank to use.
ChangeVetoException
- if the new rank is unacceptable.public int getRank()
getRank
in interface RankedDocRef
public DocRef getDocumentReference()
getDocumentReference
in interface RankedDocRef
public Integer getStart()
getStart
in interface RankedDocRef
public Integer getEnd()
getEnd
in interface RankedDocRef
public void setLocation(RichLocation location) throws ChangeVetoException
setLocation
in interface RankedDocRef
location
- the location to use.
ChangeVetoException
- if the new location is unacceptable.public RichLocation getLocation()
RankedDocRef
getLocation
in interface RankedDocRef
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |