public class SimpleRankedDocRef extends AbstractChangeable implements RankedDocRef
LOCATION, RANK
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
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"
|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
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()
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)
public int compareTo(Object o)
compareTo
in interface Comparable
Copyright © 2014 BioJava. All rights reserved.