Package org.biojavax
Interface RichAnnotation
- All Superinterfaces:
Annotation
,Changeable
- All Known Implementing Classes:
EmptyRichAnnotation
,SimpleRichAnnotation
An annotation collection which stores annotations as Note objects.
- Since:
- 1.5
- Author:
- Richard Holland, Mark Schreiber
- See Also:
-
Field Summary
FieldsFields inherited from interface org.biojava.bio.Annotation
PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a note to this annotation.void
clear()
Removes all notes from this annotation object.boolean
Returns true if the given note exists in this annotation.Uses the term and rank to lookup a note in this annotation.Returns an immutable set of all notes in this annotation.Note[]
getProperties
(Object key) Find all theNote
s with any rank that match the key.void
removeNote
(Note note) Removes a note from this annotation.void
setNoteSet
(Set<Note> notes) Clears the notes from this annotation and replaces them with those from the given set.Methods inherited from interface org.biojava.bio.Annotation
asMap, containsProperty, getProperty, keys, removeProperty, setProperty
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
EMPTY_ANNOTATION
-
-
Method Details
-
clear
Removes all notes from this annotation object.- Throws:
ChangeVetoException
- if it couldn't do it.
-
addNote
Adds a note to this annotation. Must not be null. If the note is already in the annotation, nothing happens.- Parameters:
note
- note to add- Throws:
ChangeVetoException
- if it doesn't like this.
-
removeNote
Removes a note from this annotation. Must not be null. If the note wasn't in the annotation, nothing happens.- Parameters:
note
- note to remove- Throws:
ChangeVetoException
- if it doesn't like this.
-
getNote
Uses the term and rank to lookup a note in this annotation.- Parameters:
note
- note to lookup, using term and rank.- Returns:
- the matching note.
- Throws:
ChangeVetoException
- if it doesn't like this.NoSuchElementException
- if it couldn't be found.
-
contains
Returns true if the given note exists in this annotation. The lookup is done using the term and rank of the note.- Parameters:
note
- note to lookup- Returns:
- true if it is in this annotation, false if not.
-
getNoteSet
Set<Note> getNoteSet()Returns an immutable set of all notes in this annotation.- Returns:
- a set of notes.
- See Also:
-
setNoteSet
Clears the notes from this annotation and replaces them with those from the given set. The set cannot be null.- Parameters:
notes
- a set of Note objects to use from now on.- Throws:
ChangeVetoException
- if it doesn't like any of them.- See Also:
-
getProperties
Find all theNote
s with any rank that match the key.- Parameters:
key
- either aString
identifier of a term from the default ontology or aComparableTerm
- Returns:
- an array of matching
Notes
in order of rank or an empty array if there are no matches. No implementation should ever return null! - See Also:
-