net.sf.okapi.common.annotation

## Class TermsAnnotation

- java.lang.Object
- - net.sf.okapi.common.annotation.TermsAnnotation

- All Implemented Interfaces:
    IAnnotation

      public class TermsAnnotation
      extends java.lang.Object
      implements IAnnotation

  Simple annotation for storing terms and their associated information.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TermsAnnotation()` Creates a new empty TermsAnnotation object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(java.lang.String term, java.lang.String info)` Adds a term to the annotation.
    `java.lang.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.
    `java.lang.String` | `getTerm(int index)` Gets the term for a given index.
    `int` | `size()` Gets the number of terms in this annotation.
    `java.lang.String` | `toString()` Gets a human readable representation of this annotation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TermsAnnotation

          public TermsAnnotation()

      Creates a new empty TermsAnnotation object.

  - ### Method Detail

    - #### add

          public void add(java.lang.String term,
                          java.lang.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.

    - #### getTerm

          public java.lang.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 java.lang.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 java.lang.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 `java.lang.Object`
      Returns:
        a human readable representation of this annotation.