com.tietoenator.trip.jxp.ccl

## Class TdbTermList

- java.lang.Object
- - com.tietoenator.trip.jxp.ccl.TdbTermList

- All Implemented Interfaces:
    com.tietoenator.trip.jxp.internal.utils.DOMSink, java.lang.Iterable<TdbTerm>

      public class TdbTermList
      extends java.lang.Object
      implements java.lang.Iterable<TdbTerm>, com.tietoenator.trip.jxp.internal.utils.DOMSink

  Container for a list of terms created by, e.g. a Display order.

  The TdbTermList class is from version 3.0 of TRIPjxp no longer a subclass of java.util.Vector<E>. Applications that use TdbTermList may therefore have to be modified.

  Since:
    TRIPjxp v1.0, new interface from TRIPjxp v3.0.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TdbTermList()` Creates an empty term list instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears the retrieved terms from the TdbTermList object.
    `void` | `close()` Releases server-side resources associated wih this term list and invalidates it.
    `TdbTerm` | `get(int index)` Returns a TdbTerm instance for the term at the specified index.
    `java.lang.String` | `getCommand()` Get the CCL command that generated this term list
    `boolean` | `isEmpty()` Returns true if there are no terms in this term list.
    `boolean` | `isOnDemand()` Returns true if the term list values are retrieved from the server on demand (value is true), or if the entire term list is retrieved in one go up front (value is false).
    `boolean` | `isValid()` Returns true if the term list is valid for use.
    `java.util.Iterator<TdbTerm>` | `iterator()` Returns an iterator over the terms in this term list.
    `int` | `size()` Returns the total number of terms associated with this term list.
    `TdbTerm[]` | `toArray()` Returns the entire term list as an array.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

    - ### Methods inherited from interface com.tietoenator.trip.jxp.internal.utils.DOMSink

      `sinkNode`

- - ### Constructor Detail

    - #### TdbTermList

          public TdbTermList()

      Creates an empty term list instance.

  - ### Method Detail

    - #### size

          public int size()

      Returns the total number of terms associated with this term list.
      Returns:
        Term list size

    - #### isEmpty

          public boolean isEmpty()

      Returns true if there are no terms in this term list.
      Returns:
        True if there are no terms and false otherwise.

    - #### isValid

          public boolean isValid()

      Returns true if the term list is valid for use. A list may become invalid if its values are retrieved on-demand and the list has not been accessed for a while.
      Returns:
        True if list is valid

    - #### isOnDemand

          public boolean isOnDemand()

      Returns true if the term list values are retrieved from the server on demand (value is true), or if the entire term list is retrieved in one go up front (value is false).

      On-demand retrieval requires TRIPsystem 7.0 or later.

      On-demand term lists can also be used concurrently; an application can have multiple TdbTermList instances active at the same time, based on different DISPLAY order results.

      Returns:
        True if term list values are retrieved on demand.

    - #### getCommand

          public java.lang.String getCommand()

      Get the CCL command that generated this term list
      Returns:
        Parsed CCL command

    - #### iterator

          public java.util.Iterator<TdbTerm> iterator()

      Returns an iterator over the terms in this term list.
      Specified by:
        `iterator` in interface `java.lang.Iterable<TdbTerm>`
      Returns:
        A term iterator object to use with the "foreach" statement.

    - #### toArray

          public TdbTerm[] toArray()
                            throws TdbException

      Returns the entire term list as an array. This may consume significant resources if the term list is large, so if you only want a few of the terms (e.g. term 1-20), you should use the #get(int) or #iterator() methods instead.
      Returns:
        An array of TdbTerm objects
      Throws:
        `TdbException` - If the terms could not be returned
      See Also:
        `TdbTermList.get(int)`, `TdbTermList.iterator()`

    - #### clear

          public void clear()

      Clears the retrieved terms from the TdbTermList object. The term list is still valid for use, but any terms must be retrieved again from the server.

    - #### close

          public void close()

      Releases server-side resources associated wih this term list and invalidates it. After this method has been called, the TdbTermList object is no longer valid for use.

    - #### get

          public TdbTerm get(int index)
                      throws TdbException

      Returns a TdbTerm instance for the term at the specified index.
      Parameters:
        `index` - The zero-based index of the term in the term list.
      Returns:
        A TdbTerm instance
      Throws:
        `TdbException` - If the term could not be returned When used with TRIPsystem 7.0 or later, this method will occasionally cause network I/O.