info.bioinfweb.jphyloio.events

## Interface JPhyloIOEvent

- All Known Subinterfaces:
    LinkedIDEvent
  All Known Implementing Classes:
    CharacterDefinitionEvent, CharacterSetIntervalEvent, CommentEvent, ConcreteJPhyloIOEvent, ContinuedEvent, EdgeEvent, LabeledEvent, LabeledIDEvent, LinkedLabeledIDEvent, LiteralMetadataContentEvent, LiteralMetadataEvent, NodeEvent, PartEndEvent, ResourceMetadataEvent, SequenceTokensEvent, SetElementEvent, SingleSequenceTokenEvent, SingleTokenDefinitionEvent, TokenSetDefinitionEvent, UnknownCommandEvent

      public interface JPhyloIOEvent

  This interface is implemented by all events generated by implementations of `JPhyloIOEventReader`.

  Events in JPhyloIO are generated by implementations of `JPhyloIOEventReader` in an order according to the grammar specified in the documentation of that class. The type of data that is represented by an event is determined by its `EventContentType`. For some content types a start and an end event exist to allow the sequential representation of nested information (e.g. the sequences of an alignment) and for others only one sole event will be generated. This is defined by the `EventTopologyType`. Both types can be determined using `getType()`.

  Author:
    Ben Stöver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `CharacterDefinitionEvent` | `asCharacterDefinitionEvent()` Casts this event to a character definition event.
    `CharacterSetIntervalEvent` | `asCharacterSetIntervalEvent()` Casts this event to a character set event.
    `CommentEvent` | `asCommentEvent()` Casts this event to a comment event.
    `EdgeEvent` | `asEdgeEvent()` Casts this event to a tree or graph edge event.
    `LabeledIDEvent` | `asLabeledIDEvent()` Casts this event to a labeled ID event.
    `LinkedLabeledIDEvent` | `asLinkedLabeledIDEvent()` Casts this event to a basic OTU event.
    `LiteralMetadataContentEvent` | `asLiteralMetadataContentEvent()` Casts this event to a literal content metadata event.
    `LiteralMetadataEvent` | `asLiteralMetadataEvent()` Casts this event to a literal metadata event.
    `NodeEvent` | `asNodeEvent()` Casts this event to a tree or graph node event.
    `PartEndEvent` | `asPartEndEvent()` Casts this event to a part end event.
    `ResourceMetadataEvent` | `asResourceMetadataEvent()` Casts this event to a resource metadata event.
    `SequenceTokensEvent` | `asSequenceTokensEvent()` Casts this event to a tokens event.
    `SetElementEvent` | `asSetElementEvent()` Casts this event to a set element event.
    `SingleSequenceTokenEvent` | `asSingleSequenceTokenEvent()` Casts this event to a single token event.
    `SingleTokenDefinitionEvent` | `asSingleTokenDefinitionEvent()` Casts this event to a single character state symbol definition event.
    `TokenSetDefinitionEvent` | `asTokenSetDefinitionEvent()` Casts this event to a character state set definition event.
    `UnknownCommandEvent` | `asUnknownCommandEvent()` Casts this event to an unknown command event.
    `EventType` | `getType()` Returns the type of this event.

- - ### Method Detail

    - #### getType

          EventType getType()

      Returns the type of this event.
      Returns:
        the event type

    - #### asResourceMetadataEvent

          ResourceMetadataEvent asResourceMetadataEvent()
                                                 throws java.lang.ClassCastException

      Casts this event to a resource metadata event.
      Returns:
        a reference to this event as a resource metadata event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `ResourceMetadataEvent`

    - #### asLiteralMetadataEvent

          LiteralMetadataEvent asLiteralMetadataEvent()
                                               throws java.lang.ClassCastException

      Casts this event to a literal metadata event.
      Returns:
        a reference to this event as a literal metadata event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LiteralMetadataEvent`

    - #### asLiteralMetadataContentEvent

          LiteralMetadataContentEvent asLiteralMetadataContentEvent()
                                                             throws java.lang.ClassCastException

      Casts this event to a literal content metadata event.
      Returns:
        a reference to this event as a literal content metadata event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LiteralMetadataContentEvent`

    - #### asUnknownCommandEvent

          UnknownCommandEvent asUnknownCommandEvent()
                                             throws java.lang.ClassCastException

      Casts this event to an unknown command event.
      Returns:
        a reference to this event as an unknown command event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `UnknownCommandEvent`

    - #### asCommentEvent

          CommentEvent asCommentEvent()
                               throws java.lang.ClassCastException

      Casts this event to a comment event.
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CommentEvent`

    - #### asLabeledIDEvent

          LabeledIDEvent asLabeledIDEvent()
                                   throws java.lang.ClassCastException

      Casts this event to a labeled ID event.
      Returns:
        a reference to this event as a labeled ID event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LabeledIDEvent`

    - #### asSetElementEvent

          SetElementEvent asSetElementEvent()
                                     throws java.lang.ClassCastException

      Casts this event to a set element event.
      Returns:
        a reference to this event as a set element event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SetElementEvent`

    - #### asPartEndEvent

          PartEndEvent asPartEndEvent()
                               throws java.lang.ClassCastException

      Casts this event to a part end event.
      Returns:
        a reference to this event as a part end event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `PartEndEvent`

    - #### asLinkedLabeledIDEvent

          LinkedLabeledIDEvent asLinkedLabeledIDEvent()
                                               throws java.lang.ClassCastException

      Casts this event to a basic OTU event.
      Returns:
        a reference to this event as a basic OTU event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LinkedLabeledIDEvent`

    - #### asSequenceTokensEvent

          SequenceTokensEvent asSequenceTokensEvent()
                                             throws java.lang.ClassCastException

      Casts this event to a tokens event.
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SequenceTokensEvent`

    - #### asSingleSequenceTokenEvent

          SingleSequenceTokenEvent asSingleSequenceTokenEvent()
                                                       throws java.lang.ClassCastException

      Casts this event to a single token event.
      Returns:
        a reference to this event as a single token event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SingleSequenceTokenEvent`

    - #### asCharacterSetIntervalEvent

          CharacterSetIntervalEvent asCharacterSetIntervalEvent()
                                                         throws java.lang.ClassCastException

      Casts this event to a character set event.
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CharacterSetIntervalEvent`

    - #### asCharacterDefinitionEvent

          CharacterDefinitionEvent asCharacterDefinitionEvent()
                                                       throws java.lang.ClassCastException

      Casts this event to a character definition event.
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CharacterDefinitionEvent`

    - #### asTokenSetDefinitionEvent

          TokenSetDefinitionEvent asTokenSetDefinitionEvent()
                                                     throws java.lang.ClassCastException

      Casts this event to a character state set definition event.
      Returns:
        a reference to this event as a token set definition event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `TokenSetDefinitionEvent`

    - #### asSingleTokenDefinitionEvent

          SingleTokenDefinitionEvent asSingleTokenDefinitionEvent()
                                                           throws java.lang.ClassCastException

      Casts this event to a single character state symbol definition event.
      Returns:
        a reference to this event as a token definition event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SingleTokenDefinitionEvent`

    - #### asEdgeEvent

          EdgeEvent asEdgeEvent()
                         throws java.lang.ClassCastException

      Casts this event to a tree or graph edge event.
      Returns:
        a reference to this event as an edge event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `EdgeEvent`

    - #### asNodeEvent

          NodeEvent asNodeEvent()
                         throws java.lang.ClassCastException

      Casts this event to a tree or graph node event.
      Returns:
        a reference to this event as a node event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `NodeEvent`