public class SimpleNote extends AbstractChangeable implements Note
Modifier | Constructor and Description |
---|---|
protected |
SimpleNote() |
|
SimpleNote(ComparableTerm term,
java.lang.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(java.lang.Object o)
Notes are compared first by rank, then by the term.
|
boolean |
equals(java.lang.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.
|
java.lang.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(java.lang.String value)
Sets the value for this note, or null for no value.
|
java.lang.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, java.lang.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 java.lang.String getValue()
public void setValue(java.lang.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(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object