public class SimpleNote extends AbstractChangeable implements Note
Modifier | Constructor and Description |
---|---|
protected |
SimpleNote() |
|
SimpleNote(ComparableTerm term,
String value,
int rank)
Creates a new instance of SimpleNote with a given term, value and rank.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Notes are compared first by rank, then by the term.
|
boolean |
equals(Object o)
Notes are equal if they have the same rank and term.
|
int |
getRank()
Gets the rank that defines this note.
|
ComparableTerm |
getTerm()
Gets the term that defines this note.
|
String |
getValue()
Gets the value that defines this note.
|
int |
hashCode() |
void |
setRank(int rank)
Sets the rank for this note.
|
void |
setTerm(ComparableTerm term)
Sets the term for this note.
|
void |
setValue(String value)
Sets the value for this note, or null for no value.
|
String |
toString()
Form: "(#rank) term: value"
|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public SimpleNote(ComparableTerm term, String value, int rank)
term
- the term of the note. Cannot be null.value
- the (optional) value to give it.rank
- the rank to give it.protected SimpleNote()
public ComparableTerm getTerm()
public void setTerm(ComparableTerm term) throws ChangeVetoException
setTerm
in interface Note
term
- the term to use.ChangeVetoException
- if it doesn't like the term.public void setValue(String value) throws ChangeVetoException
setValue
in interface Note
value
- the value to use.ChangeVetoException
- if it doesn't like the value.public int getRank()
public void setRank(int rank) throws ChangeVetoException
setRank
in interface Note
rank
- the rank to use.ChangeVetoException
- if it doesn't like the rank.public int compareTo(Object o)
compareTo
in interface Comparable
Copyright © 2014 BioJava. All rights reserved.