Package org.biojavax
Class SimpleNote
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.SimpleNote
- All Implemented Interfaces:
Comparable,Changeable,Note
Simple implementation of Note.
- Since:
- 1.5
- Author:
- Richard Holland, George Waldon - limited firing
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleNote(ComparableTerm term, String value, int rank) Creates a new instance of SimpleNote with a given term, value and rank. -
Method Summary
Modifier and TypeMethodDescriptionintNotes are compared first by rank, then by the term.booleanNotes are equal if they have the same rank and term.intgetRank()Gets the rank that defines this note.getTerm()Gets the term that defines this note.getValue()Gets the value that defines this note.inthashCode()voidsetRank(int rank) Sets the rank for this note.voidsetTerm(ComparableTerm term) Sets the term for this note.voidSets the value for this note, or null for no value.toString()Form: "(#rank) term: value"Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
SimpleNote
Creates a new instance of SimpleNote with a given term, value and rank.- Parameters:
term- the term of the note. Cannot be null.value- the (optional) value to give it.rank- the rank to give it.
-
SimpleNote
protected SimpleNote()
-
-
Method Details
-
getTerm
Gets the term that defines this note. -
setTerm
Sets the term for this note. It cannot be null.- Specified by:
setTermin interfaceNote- Parameters:
term- the term to use.- Throws:
ChangeVetoException- if it doesn't like the term.
-
getValue
Gets the value that defines this note. -
setValue
Sets the value for this note, or null for no value.- Specified by:
setValuein interfaceNote- Parameters:
value- the value to use.- Throws:
ChangeVetoException- if it doesn't like the value.
-
getRank
Gets the rank that defines this note. -
setRank
Sets the rank for this note.- Specified by:
setRankin interfaceNote- Parameters:
rank- the rank to use.- Throws:
ChangeVetoException- if it doesn't like the rank.
-
compareTo
Notes are compared first by rank, then by the term.- Specified by:
compareToin interfaceComparable
-
equals
Notes are equal if they have the same rank and term. -
hashCode
-
toString
Form: "(#rank) term: value"
-