com.tietoenator.trip.jxp.classification

## Class TdbCategory

- java.lang.Object
- - com.tietoenator.trip.jxp.session.TdbSessionObject
  - - com.tietoenator.trip.jxp.TdbMessageProvider
    - - com.tietoenator.trip.jxp.classification.TdbCategory

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

      public class TdbCategory
      extends TdbMessageProvider
      implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, java.lang.Iterable<TdbTrainingInfo>

  Container and manipulation logic for a single category from a classification scheme

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TdbCategory(TdbSession session)` Constructor, creates a blank instance
    `TdbCategory(TdbSession session, TdbControlObject ob)` Constructor, creates an instance for the category referenced by the provided Control object

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `get()` Retrieve information about the category.
    `java.lang.String` | `getComment()` Retrieve any comment associated with the category
    `TdbControlObject` | `getControlObject()` Retrieve the Control object reference with which the category was constructed
    `int` | `getId()` Retrieve the unique ID assigned by the server to this category
    `java.lang.String` | `getName()` Retrieve the name of the category
    `TdbClassificationScheme` | `getScheme()` Retrieve a reference to the classification scheme with which this category is associated
    `java.util.Iterator<TdbTrainingInfo>` | `iterator()` Retrieve an iterator over the collection of training information available for this category
    `void` | `rename()` Rename the category and/or provide it with a new comment.
    `void` | `setComment(java.lang.String comment)` Establish a comment to be associated with the category
    `void` | `setName(java.lang.String name)` Establish the name of the category
    `void` | `train(java.lang.String data, java.lang.String filename, TdbTrainingInfo info)` Add training data to the category.
    `java.util.Collection<TdbTrainingInfo>` | `trainingInfo()` Retrieve a copy of the collection of training information available for this category
    `void` | `untrain()` Remove all training data for this category.

    - ### Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider

      `codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages`

    - ### Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject

      `cancel, getSession, isCancelable, setCancelable`

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

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

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

      `sinkNode`

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

      `forEach, spliterator`

- - ### Constructor Detail

    - #### TdbCategory

          public TdbCategory(TdbSession session,
                             TdbControlObject ob)
                      throws TdbException

      Constructor, creates an instance for the category referenced by the provided Control object
      Parameters:
        `session` - Active session
        `ob` - Control object referencing the category
      Throws:
        `TdbException`

    - #### TdbCategory

          public TdbCategory(TdbSession session)
                      throws TdbException

      Constructor, creates a blank instance
      Parameters:
        `session` - Active session
      Throws:
        `TdbException`

  - ### Method Detail

    - #### getScheme

          public TdbClassificationScheme getScheme()

      Retrieve a reference to the classification scheme with which this category is associated
      Returns:
        Reference to the containing classification scheme

    - #### getName

          public java.lang.String getName()

      Retrieve the name of the category
      Returns:
        Category name

    - #### setName

          public void setName(java.lang.String name)

      Establish the name of the category
      Parameters:
        `name` - The name of the new category

    - #### getComment

          public java.lang.String getComment()

      Retrieve any comment associated with the category
      Returns:
        Category comment, if any

    - #### setComment

          public void setComment(java.lang.String comment)

      Establish a comment to be associated with the category
      Parameters:
        `comment` - Category comment

    - #### getId

          public int getId()
                    throws TdbException

      Retrieve the unique ID assigned by the server to this category
      Returns:
        Category ID
      Throws:
        `TdbException`

    - #### getControlObject

          public TdbControlObject getControlObject()

      Retrieve the Control object reference with which the category was constructed
      Specified by:
        `getControlObject` in interface `TdbControlObjectProvider`
      Returns:
        Control object reference

    - #### iterator

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

      Retrieve an iterator over the collection of training information available for this category
      Specified by:
        `iterator` in interface `java.lang.Iterable<TdbTrainingInfo>`
      Returns:
        Training information iterator

    - #### trainingInfo

          public java.util.Collection<TdbTrainingInfo> trainingInfo()

      Retrieve a copy of the collection of training information available for this category
      Returns:
        Training information collection

    - #### rename

          public void rename()
                      throws TdbException

      Rename the category and/or provide it with a new comment. Invoking this method causes network I/O.
      Throws:
        `TdbException`

    - #### train

          public void train(java.lang.String data,
                            java.lang.String filename,
                            TdbTrainingInfo info)
                     throws TdbException

      Add training data to the category. Invoking this method causes network I/O.
      Parameters:
        `data` - Training data
        `filename` - (optional) Filename from which training data was read
        `info` - If not null, on completion will contain the new training information summary
      Throws:
        `TdbException`

    - #### untrain

          public void untrain()
                       throws TdbException

      Remove all training data for this category. Invoking this method causes network I/O.
      Throws:
        `TdbException`

    - #### get

          public void get()
                   throws TdbException

      Retrieve information about the category. Invoking this method causes network I/O.
      Throws:
        `TdbException`