public class CharacterSetIntervalEvent extends ConcreteJPhyloIOEvent
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.
Constructor and Description |
---|
CharacterSetIntervalEvent(long start,
long end)
Creates a new instance of this class.
|
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.
|
asCharacterDefinitionEvent, asCharacterSetIntervalEvent, asCommentEvent, asEdgeEvent, asLabeledIDEvent, asLinkedLabeledIDEvent, asLiteralMetadataContentEvent, asLiteralMetadataEvent, asNodeEvent, asPartEndEvent, asResourceMetadataEvent, asSequenceTokensEvent, asSetElementEvent, asSingleSequenceTokenEvent, asSingleTokenDefinitionEvent, asTokenSetDefinitionEvent, asUnknownCommandEvent, createEndEvent, getType
public CharacterSetIntervalEvent(long start, long end)
A segment ranges from getStart()
to getEnd()
- 1
.
start
- the index of the first position of the sequence segment to be add to the specified character setend
- the first index after the end of the sequence segment to be add to the specified character setjava.lang.IndexOutOfBoundsException
- if start
or end
are below 0java.lang.IllegalArgumentException
- if end
is not greater than start
(If a character set shall have
no length, just omit nested interval event.)public long getStart()
A segment ranges from getStart()
to getEnd() - 1
.
public long getEnd()
A segment ranges from getStart()
to getEnd() - 1
.