Package org.biojavax

Interface RichAnnotation

    • Method Detail

      • 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.
      • 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

        Set<NotegetNoteSet()
        Returns an immutable set of all notes in this annotation.
        Returns:
        a set of notes.
        See Also:
        Note
      • 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:
        Note
      • getProperties

        Note[] getProperties​(Object key)
        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:
        Note, ComparableTerm