info.bioinfweb.jphyloio.events

## Class SingleTokenDefinitionEvent

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

- All Implemented Interfaces:
    JPhyloIOEvent

      public class SingleTokenDefinitionEvent
      extends LabeledIDEvent

  Event that indicates the definition of a single new valid token that could be contained in a sequence of the current alignment.

  Not all formats support or require a token definition, therefore sequences might contain tokens that were not previously defined by `SingleTokenDefinitionEvent`.

  Since:
    0.0.0
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingleTokenDefinitionEvent(java.lang.String id, java.lang.String label, java.lang.String tokenName, CharacterSymbolMeaning meaning, CharacterSymbolType tokenType)` Creates a new instance of this class without a constituents collection.
    `SingleTokenDefinitionEvent(java.lang.String id, java.lang.String label, java.lang.String tokenName, CharacterSymbolMeaning meaning, CharacterSymbolType tokenType, java.util.Collection<java.lang.String> constituents)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Collection<java.lang.String>` | `getConstituents()` Returns a collection of tokens that are constituents of this token (e.g.
    `CharacterSymbolMeaning` | `getMeaning()` Returns the meaning of the new token.
    `java.lang.String` | `getTokenName()` Returns the string representation of the new token.
    `CharacterSymbolType` | `getTokenType()` Returns the type of the new token (e.g.
    `boolean` | `hasConstituents()` Returns true if a collection of constituents is specified for this token or false if it is not.

    - ### 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

    - #### SingleTokenDefinitionEvent

          public SingleTokenDefinitionEvent(java.lang.String id,
                                            java.lang.String label,
                                            java.lang.String tokenName,
                                            CharacterSymbolMeaning meaning,
                                            CharacterSymbolType tokenType,
                                            java.util.Collection<java.lang.String> constituents)

      Creates a new instance of this class.
      Parameters:
        `id` - the unique ID associated with the represented single token definition (Must be a valid NCName.)
        `label` - an optional label of the modeled single token definition (Maybe `null`, if no label is present. This is not the token name.)
        `tokenName` - the string representation of the new token
        `meaning` - the meaning of the new token
        `constituents` - if this token is an ambiguity or uncertain token, a list of constituents can be specified here (Maybe `null`.)
      Throws:
        `java.lang.NullPointerException` - if `null` is specified for any of the arguments

    - #### SingleTokenDefinitionEvent

          public SingleTokenDefinitionEvent(java.lang.String id,
                                            java.lang.String label,
                                            java.lang.String tokenName,
                                            CharacterSymbolMeaning meaning,
                                            CharacterSymbolType tokenType)

      Creates a new instance of this class without a constituents collection.
      Parameters:
        `tokenName` - the string representation of the new token
        `meaning` - the meaning of the new token
      Throws:
        `java.lang.NullPointerException` - if `null` is specified for any of the arguments

  - ### Method Detail

    - #### getTokenName

          public java.lang.String getTokenName()

      Returns the string representation of the new token.
      Returns:
        the string representation of one or more characters in length

    - #### getMeaning

          public CharacterSymbolMeaning getMeaning()

      Returns the meaning of the new token.
      Returns:
        the meaning

    - #### getTokenType

          public CharacterSymbolType getTokenType()

      Returns the type of the new token (e.g. UNCERTAIN if the token definition is an ambiguity code).
      Returns:
        the tokenType

    - #### getConstituents

          public java.util.Collection<java.lang.String> getConstituents()

      Returns a collection of tokens that are constituents of this token (e.g. in case of ambiguity codes) or null, if no constituents are specified.
      Returns:
        a collection of constituents or null

    - #### hasConstituents

          public boolean hasConstituents()

      Returns true if a collection of constituents is specified for this token or false if it is not.
      Returns:
        true if this token has constituents that are specified or false if not