info.bioinfweb.jphyloio.events

## Class ConcreteJPhyloIOEvent

- java.lang.Object
- - info.bioinfweb.jphyloio.events.ConcreteJPhyloIOEvent

- All Implemented Interfaces:
    JPhyloIOEvent
  Direct Known Subclasses:
    CharacterSetIntervalEvent, ContinuedEvent, LabeledEvent, PartEndEvent, SequenceTokensEvent, SetElementEvent, UnknownCommandEvent

      public class ConcreteJPhyloIOEvent
      extends java.lang.Object
      implements JPhyloIOEvent

  Implements basic functionality for `JPhyloIOEvent`s.
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcreteJPhyloIOEvent(EventContentType contentType, EventTopologyType topologyType)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete 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.
    `static ConcreteJPhyloIOEvent` | `createEndEvent(EventContentType contentType)` Creates a new instance of this class with the topology type `EventTopologyType.END`-
    `EventType` | `getType()` Returns the type of this event.

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

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

- - ### Constructor Detail

    - #### ConcreteJPhyloIOEvent

          public ConcreteJPhyloIOEvent(EventContentType contentType,
                                       EventTopologyType topologyType)

      Creates a new instance of this class.
      Parameters:
        `contentType` - the content type of the event
        `topologyType` - the topology type of the event
      Throws:
        `java.lang.NullPointerException` - if `contentType` or `topologyType` are `null`

  - ### Method Detail

    - #### createEndEvent

          public static ConcreteJPhyloIOEvent createEndEvent(EventContentType contentType)

      Creates a new instance of this class with the topology type `EventTopologyType.END`-
      Parameters:
        `contentType` - the content type of the event
      Returns:
        the new event instance
      Throws:
        `java.lang.NullPointerException` - if `contentType` is `null`
      See Also:
        `PartEndEvent`

    - #### getType

          public EventType getType()

      Description copied from interface: `JPhyloIOEvent`
      Returns the type of this event.
      Specified by:
        `getType` in interface `JPhyloIOEvent`
      Returns:
        the event type

    - #### asResourceMetadataEvent

          public ResourceMetadataEvent asResourceMetadataEvent()
                                                        throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a resource metadata event.
      Specified by:
        `asResourceMetadataEvent` in interface `JPhyloIOEvent`
      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

          public LiteralMetadataEvent asLiteralMetadataEvent()
                                                      throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a literal metadata event.
      Specified by:
        `asLiteralMetadataEvent` in interface `JPhyloIOEvent`
      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

          public LiteralMetadataContentEvent asLiteralMetadataContentEvent()
                                                                    throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a literal content metadata event.
      Specified by:
        `asLiteralMetadataContentEvent` in interface `JPhyloIOEvent`
      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

          public UnknownCommandEvent asUnknownCommandEvent()
                                                    throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to an unknown command event.
      Specified by:
        `asUnknownCommandEvent` in interface `JPhyloIOEvent`
      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

          public CommentEvent asCommentEvent()
                                      throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a comment event.
      Specified by:
        `asCommentEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CommentEvent`

    - #### asSetElementEvent

          public SetElementEvent asSetElementEvent()
                                            throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a set element event.
      Specified by:
        `asSetElementEvent` in interface `JPhyloIOEvent`
      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

          public PartEndEvent asPartEndEvent()
                                      throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a part end event.
      Specified by:
        `asPartEndEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a part end event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `PartEndEvent`

    - #### asLabeledIDEvent

          public LabeledIDEvent asLabeledIDEvent()
                                          throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a labeled ID event.
      Specified by:
        `asLabeledIDEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a labeled ID event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LabeledIDEvent`

    - #### asLinkedLabeledIDEvent

          public LinkedLabeledIDEvent asLinkedLabeledIDEvent()
                                                      throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a basic OTU event.
      Specified by:
        `asLinkedLabeledIDEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a basic OTU event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `LinkedLabeledIDEvent`

    - #### asSingleSequenceTokenEvent

          public SingleSequenceTokenEvent asSingleSequenceTokenEvent()
                                                              throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a single token event.
      Specified by:
        `asSingleSequenceTokenEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a single token event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SingleSequenceTokenEvent`

    - #### asSequenceTokensEvent

          public SequenceTokensEvent asSequenceTokensEvent()
                                                    throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a tokens event.
      Specified by:
        `asSequenceTokensEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `SequenceTokensEvent`

    - #### asCharacterSetIntervalEvent

          public CharacterSetIntervalEvent asCharacterSetIntervalEvent()
                                                                throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a character set event.
      Specified by:
        `asCharacterSetIntervalEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CharacterSetIntervalEvent`

    - #### asCharacterDefinitionEvent

          public CharacterDefinitionEvent asCharacterDefinitionEvent()
                                                              throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a character definition event.
      Specified by:
        `asCharacterDefinitionEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a tokens event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `CharacterDefinitionEvent`

    - #### asTokenSetDefinitionEvent

          public TokenSetDefinitionEvent asTokenSetDefinitionEvent()
                                                            throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a character state set definition event.
      Specified by:
        `asTokenSetDefinitionEvent` in interface `JPhyloIOEvent`
      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

          public SingleTokenDefinitionEvent asSingleTokenDefinitionEvent()
                                                                  throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a single character state symbol definition event.
      Specified by:
        `asSingleTokenDefinitionEvent` in interface `JPhyloIOEvent`
      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

          public EdgeEvent asEdgeEvent()
                                throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a tree or graph edge event.
      Specified by:
        `asEdgeEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as an edge event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `EdgeEvent`

    - #### asNodeEvent

          public NodeEvent asNodeEvent()
                                throws java.lang.ClassCastException

      Description copied from interface: `JPhyloIOEvent`
      Casts this event to a tree or graph node event.
      Specified by:
        `asNodeEvent` in interface `JPhyloIOEvent`
      Returns:
        a reference to this event as a node event
      Throws:
        `java.lang.ClassCastException` - if this event is not an instance of `NodeEvent`