Package org.biojavax

Interface RichAnnotation

All Superinterfaces:
Annotation, Changeable
All Known Implementing Classes:
EmptyRichAnnotation, SimpleRichAnnotation

public interface RichAnnotation extends Annotation
An annotation collection which stores annotations as Note objects.
Since:
1.5
Author:
Richard Holland, Mark Schreiber
See Also:
  • Field Details

  • Method Details

    • clear

      void clear() throws ChangeVetoException
      Removes all notes from this annotation object.
      Throws:
      ChangeVetoException - if it couldn't do it.
    • addNote

      void addNote(Note note) throws ChangeVetoException
      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

      void removeNote(Note note) throws ChangeVetoException
      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

      boolean contains(Note note)
      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

      Returns an immutable set of all notes in this annotation.
      Returns:
      a set of notes.
      See Also:
    • setNoteSet

      void setNoteSet(Set<Note> notes) throws ChangeVetoException
      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 the Notes with any rank that match the key.
      Parameters:
      key - either a String identifier of a term from the default ontology or a ComparableTerm
      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: