info.bioinfweb.jphyloio.events

## Class TokenSetDefinitionEvent

- java.lang.Object
- - info.bioinfweb.jphyloio.events.ConcreteJPhyloIOEvent
  - - info.bioinfweb.jphyloio.events.LabeledEvent
    - - info.bioinfweb.jphyloio.events.LabeledIDEvent
      - - info.bioinfweb.jphyloio.events.TokenSetDefinitionEvent

- All Implemented Interfaces:
    JPhyloIOEvent

      public class TokenSetDefinitionEvent
      extends LabeledIDEvent

  Event that indicates that a (predefined) definition of a character state set was found in the parsed file.

  This event may or may not occur in combination with one or more `SingleTokenDefinitionEvent`, which define single tokens (e.g. nucleotides or the gap character) used in this set. If no or only a few of the tokens implied by the return value of `getSetType()` are defined by nested events, the remaining one are still assumed to be part of the tokens set.

  JPhyloIO enumerates some standard token sets in `TokenSetType`. Some formats might define additional sets which would be represented as `TokenSetType#UNKNOWN`. Application developers would have to rely on `LabeledEvent.getLabel()` in such cases, to determine the meaning.

  Author:
    Ben Stöver, Sarah Wiechers

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenSetDefinitionEvent(CharacterStateSetType type, java.lang.String id, java.lang.String label)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CharacterStateSetType` | `getSetType()` Returns the meaning of the the new character state set.

    - ### Methods inherited from class info.bioinfweb.jphyloio.events.LabeledIDEvent

      `checkID, getID`

    - ### Methods inherited from class info.bioinfweb.jphyloio.events.LabeledEvent

      `getLabel, hasLabel`

    - ### Methods inherited from class info.bioinfweb.jphyloio.events.ConcreteJPhyloIOEvent

      `asCharacterDefinitionEvent, asCharacterSetIntervalEvent, asCommentEvent, asEdgeEvent, asLabeledIDEvent, asLinkedLabeledIDEvent, asLiteralMetadataContentEvent, asLiteralMetadataEvent, asNodeEvent, asPartEndEvent, asResourceMetadataEvent, asSequenceTokensEvent, asSetElementEvent, asSingleSequenceTokenEvent, asSingleTokenDefinitionEvent, asTokenSetDefinitionEvent, asUnknownCommandEvent, createEndEvent, getType`

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

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

- - ### Constructor Detail

    - #### TokenSetDefinitionEvent

          public TokenSetDefinitionEvent(CharacterStateSetType type,
                                         java.lang.String id,
                                         java.lang.String label)

      Creates a new instance of this class.
      Parameters:
        `type` - the meaning of the token set as defined by `TokenSetType`
        `id` - the document-wide unique ID associated with the represented token set (Must be a valid NCName.)
        `label` - a name describing this token set
      Throws:
        `java.lang.NullPointerException` - if `null` is specified for `type`

  - ### Method Detail

    - #### getSetType

          public CharacterStateSetType getSetType()

      Returns the meaning of the the new character state set.
      Returns:
        the meaning of the token set as defined by `TokenSetType`