Class TermsAnnotation

  • All Implemented Interfaces:
    Cloneable, IAnnotation

    public class TermsAnnotation
    extends Object
    implements IAnnotation
    Simple annotation for storing terms and their associated information.
    • Constructor Detail

      • TermsAnnotation

        public TermsAnnotation()
        Creates a new empty TermsAnnotation object.
    • Method Detail

      • add

        public void add​(String term,
                        String info)
        Adds a term to the annotation.
        Parameters:
        term - the term to add.
        info - the associated into (can be null).
      • size

        public int size()
        Gets the number of terms in this annotation.
        Returns:
        the number of terms in this annotation.
      • isEmpty

        public boolean isEmpty()
        Returns true if there are terms in this annotation.
        Returns:
        true if terms exist in this annotation.
      • getTerm

        public String getTerm​(int index)
        Gets the term for a given index.
        Parameters:
        index - the index of the term to retrieve.
        Returns:
        the term for a given index.
      • getInfo

        public String getInfo​(int index)
        Gets the term information for a given index, or an empty string if there is not associated information for the term.
        Parameters:
        index - the index of the term information to retrieve.
        Returns:
        the term information for a given index.
      • toString

        public String toString()
        Description copied from interface: IAnnotation
        Gets a human readable representation of this annotation.
        Specified by:
        toString in interface IAnnotation
        Overrides:
        toString in class Object
        Returns:
        a human readable representation of this annotation.