info.bioinfweb.jphyloio.events

## Class LinkedLabeledIDEvent

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

- All Implemented Interfaces:
    JPhyloIOEvent, LinkedIDEvent
  Direct Known Subclasses:
    NodeEvent

      public class LinkedLabeledIDEvent
      extends LabeledIDEvent
      implements LinkedIDEvent

  Instances of this class model data elements with an ID and an optional label, that link another data element in a phylogenetic document. (Examples would be a sequence or a tree node that links an OTU, an alignment that links an OTU list or a character set that links an alignment.)
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinkedLabeledIDEvent(EventContentType contentType, java.lang.String id, java.lang.String label, java.lang.String linkedID)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getLinkedID()` Returns the ID of a data element, linked to the element modeled by this event.
    `boolean` | `hasLink()` Indicates whether this event links another data element.

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

    - ### Methods inherited from interface info.bioinfweb.jphyloio.events.JPhyloIOEvent

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

- - ### Constructor Detail

    - #### LinkedLabeledIDEvent

          public LinkedLabeledIDEvent(EventContentType contentType,
                                      java.lang.String id,
                                      java.lang.String label,
                                      java.lang.String linkedID)

      Creates a new instance of this class.
      Parameters:
        `contentType` - the content type of the modeled data element (e.g. `EventContentType.OTU` or `EventContentType.SEQUENCE`)
        `id` - the unique ID associated with the represented data element (Must be a valid NCName.)
        `label` - the label of the modeled data element (Maybe `null`, if no label is present.)
        `linkedID` - the ID if a linked data element (Maybe `null`, if none is linked.)
      Throws:
        `java.lang.NullPointerException` - if `contentType` or `id` are `null`
        `java.lang.IllegalArgumentException` - if `id` or `otuID` are not valid NCNames

  - ### Method Detail

    - #### getLinkedID

          public java.lang.String getLinkedID()

      Returns the ID of a data element, linked to the element modeled by this event.
      Specified by:
        `getLinkedID` in interface `LinkedIDEvent`
      Returns:
        the linked ID or `null` if this object does not have an associated data element

    - #### hasLink

          public boolean hasLink()

      Indicates whether this event links another data element.
      Specified by:
        `hasLink` in interface `LinkedIDEvent`
      Returns:
        `true` if an ID is present, `false` otherwise