public class TextMessage extends Object implements EventType<String>
TextMessage event has the following properties:
eventSymbol - symbol of this event;
time - time of the text message;
sequence - sequence of the text message;
text - text payload.
TextMessage.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SEQUENCE
Maximum allowed sequence value.
|
| Constructor and Description |
|---|
TextMessage()
Creates new message with default values.
|
TextMessage(String eventSymbol)
Creates new message with the specified event symbol.
|
TextMessage(String eventSymbol,
long time,
String text)
Creates new message with the specified event symbol, time and text.
|
TextMessage(String eventSymbol,
String text)
Creates new message with the specified event symbol and text.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEventSymbol()
Returns symbol for this event.
|
long |
getEventTime()
Returns time when event was created or zero when time is not available.
|
int |
getSequence()
Returns sequence number of the text message to distinguish messages that have the same
time. |
String |
getText()
Returns text.
|
long |
getTime()
Returns time of the text message.
|
long |
getTimeSequence()
Returns time and sequence of text message packaged into single long value.
|
void |
setEventSymbol(String eventSymbol)
Changes symbol for this event.
|
void |
setEventTime(long eventTime)
Changes event creation time.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number of the text message. |
void |
setText(String text)
Changes text.
|
void |
setTime(long time)
Changes time of the text message.
|
void |
setTimeSequence(long timeSequence)
Changes time and sequence of text message.
|
String |
toString()
Returns string representation of this TextMessage event.
|
public static final int MAX_SEQUENCE
setSequence(int),
Constant Field Valuespublic TextMessage()
public TextMessage(String eventSymbol)
eventSymbol - event symbol.public TextMessage(String eventSymbol, String text)
eventSymbol - event symbol.text - text.public String getEventSymbol()
getEventSymbol in interface EventType<String>public void setEventSymbol(String eventSymbol)
setEventSymbol in interface EventType<String>eventSymbol - event symbol.public long getEventTime()
This event time is available only when the corresponding DXEndpoint is created
with DXENDPOINT_EVENT_TIME_PROPERTY and
the data source has embedded event times. This is typically true only for data events
that are read from historical tape files and from OnDemandService.
Events that are coming from a network connections do not have an embedded event time information and
this method will return zero for them, meaning that event was received just now.
getEventTime in interface EventType<String>public void setEventTime(long eventTime)
setEventTime in interface EventType<String>eventTime - the difference, measured in milliseconds,
between the event creation time and midnight, January 1, 1970 UTC.public long getTimeSequence()
public void setTimeSequence(long timeSequence)
time and/or sequence.timeSequence - the time and sequence.getTimeSequence()public long getTime()
public void setTime(long time)
time - time of the text message.public int getSequence()
time. This sequence number does not have to be unique and
does not need to be sequential. Sequence can range from 0 to MAX_SEQUENCE.public void setSequence(int sequence)
getSequence() sequence number of the text message.sequence - the sequence.IllegalArgumentException - if sequence is below zero or above MAX_SEQUENCE.getSequence()public String getText()
public void setText(String text)
text - text.Copyright © 2002–2026 Devexperts LLC. All rights reserved.