|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.millistream.www.Message
public class Message
This class represents the message chain used for constructing the messages sent to the server.
Constructor Summary | |
---|---|
Message()
Constructs a new Message object. |
Method Summary | |
---|---|
boolean |
add_date(int tag,
java.lang.String value)
Adds a date field to the current message. |
boolean |
add_date2(int tag,
int year,
int month,
int day)
Adds a date field to the current message without having to construct it as a string before. |
boolean |
add_list(int tag,
java.lang.String value)
Adds a space separated list of unsigned integers to the current message. |
boolean |
add_long(int tag,
long value,
int decimals)
Adds a scaled integer field to the current message. |
boolean |
add_numeric(int tag,
java.lang.String value)
Adds a numeric field to the current message. |
boolean |
add_string(int tag,
java.lang.String value)
Adds a string field to the current message. |
boolean |
add_time(int tag,
java.lang.String value)
Adds a time field to the current message. |
boolean |
add_time2(int tag,
int hour,
int min,
int sec,
int msec)
Adds a time field to the current message without having to construct it as a string before. |
boolean |
add_time3(int tag,
int hour,
int min,
int sec,
int nsec)
Adds a time field to the current message without having to construct it as a string before, with nanosecond support. |
boolean |
add(long insref,
int mref)
Adds a new message to the message chain. |
boolean |
del()
Removes the current message from the message chain, marking it to be reused. |
protected void |
finalize()
|
static Message |
fromString(java.lang.String string)
Creates a Message from the string returned from the toString() method. |
int |
get_num_active()
Return the number of active messages in the chain. |
int |
get_num()
Return the total number of messages in the chain. |
boolean |
move(Message dst,
long insrefFrom,
long insrefTo)
Moves all messages with an insref matching insrefFrom to the Message at dst
and change it to insrefTo . |
void |
reset()
Resets the message chain so it can be reused. |
java.lang.String |
toString()
Serialize the message chain and return it as a base64 encoded string |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Message()
Message
object.
Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object
public static Message fromString(java.lang.String string)
toString()
method.
string
- a string returned from the toString()
method of a Message
class
public boolean add(long insref, int mref)
message_reference
to define which message to send.
insref
- instrument referencemref
- message reference
public boolean del()
public void reset()
del()
until it returns false.
public boolean add_list(int tag, java.lang.String value)
tag
- field tag to addvalue
- a list of unsigned integers separated by space
public boolean add_numeric(int tag, java.lang.String value)
tag
- field tag to addvalue
- the numeric value to add as a string
public boolean add_long(int tag, long value, int decimals)
tag
- field tag to addvalue
- the scaled integer valuedecimals
- the number of fixed decimals in the scaled integer
public boolean add_string(int tag, java.lang.String value)
tag
- field tag to addvalue
- the string to add
public boolean add_date(int tag, java.lang.String value)
tag
- field tag to addvalue
- the date as a string in "YYYY-MM-DD", "YYYY-MM", "YYYY-Hx", "YYYY-Tx", "YYYY-Qx" or "YYYY-Wxx" format
public boolean add_date2(int tag, int year, int month, int day)
tag
- field tag to addyear
- the Year part of the date to addmonth
- the Month part of the date to addday
- the Day part of the date to add
public boolean add_time(int tag, java.lang.String value)
tag
- field tag to addvalue
- the time as a string in "HH:MM:SS" or "HH:MM:SS.mmm" format
public boolean add_time2(int tag, int hour, int min, int sec, int msec)
tag
- field tag to addhour
- the Hour part of the timestampmin
- the Minutes part of the timestampsec
- the Seconds part of the timestampmsec
- the Milliseconds part of the timestamp
public boolean add_time3(int tag, int hour, int min, int sec, int nsec)
tag
- field tag to addhour
- the Hour part of the timestampmin
- the Minutes part of the timestampsec
- the Seconds part of the timestampnsec
- the Nanoseconds part of the timestamp
public int get_num()
get_num_active
method
is that the message chain only grows as you add new messages to it and it never shrinks even after a call to reset
or del
.
So get_num()
returns the current absolute size of the message chain, i.e the number of messages it can contain before it needs to
(automatically) be resized.
public int get_num_active()
public boolean move(Message dst, long insrefFrom, long insrefTo)
insrefFrom
to the Message at dst
and change it to insrefTo
. If dst
is set to the source object or
null
then the change from insrefFrom
to insrefTo
will be done in-place.
dst
- the Message
to move to or null
if in-place renaming of insrefs are to be done.insrefFrom
- the insref to change frominsrefTo
- the insref to change to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |