info.bioinfweb.jphyloio.events

## Class CharacterSetIntervalEvent

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

- All Implemented Interfaces:
    JPhyloIOEvent

      public class CharacterSetIntervalEvent
      extends ConcreteJPhyloIOEvent

  Event that indicates that new information on a character set has been read.

  This event defines an interval belonging to the current character set. All events of this type must be enclosed between a start and an end event with content type `EventContentType.CHARACTER_SET`. The start event will define the ID and the name of the set.

  Note that in contrast to e.g. many alignment editors or the character set definitions in Nexus, column indices in JPhyloIO start with 0 and not with 1. The indices used by instances of this class must follow this convention and readers and writers will convert indices according to the conventions of their format.

  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharacterSetIntervalEvent(long start, long end)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getEnd()` The first index after the new segment to be add to the character set with the specified name.
    `long` | `getStart()` The first position of the new segment to be add to the character set with the specified name.

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

    - #### CharacterSetIntervalEvent

          public CharacterSetIntervalEvent(long start,
                                           long end)

      Creates a new instance of this class.

      A segment ranges from `getStart()` to `getEnd()` `- 1`.

      Parameters:
        `start` - the index of the first position of the sequence segment to be add to the specified character set
        `end` - the first index after the end of the sequence segment to be add to the specified character set
      Throws:
        `java.lang.IndexOutOfBoundsException` - if `start` or `end` are below 0
        `java.lang.IllegalArgumentException` - if `end` is not greater than `start` (If a character set shall have no length, just omit nested interval event.)

  - ### Method Detail

    - #### getStart

          public long getStart()

      The first position of the new segment to be add to the character set with the specified name.

      A segment ranges from `getStart()` to `getEnd() - 1`.

      Returns:
        the first position to be included in the character set

    - #### getEnd

          public long getEnd()

      The first index after the new segment to be add to the character set with the specified name.

      A segment ranges from `getStart()` to `getEnd() - 1`.

      Returns:
        the first index after the segment to be add