Package eu.ill.webx.model
Class Message
java.lang.Object
eu.ill.webx.model.Message
- All Implemented Interfaces:
Comparable<Message>
- Direct Known Subclasses:
Message.CloseMessage,Message.InterruptMessage
Encapsulates the raw binary message data from a WebX Engine.
The priority of the message is calculated from the type of message (mouse movement is considered priority to
improve the feedback from user interactions).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCreates a Close message (used internally)static classCreates a Interrupt message (used internally)static enumEnum defining the type of the message -
Constructor Summary
ConstructorsConstructorDescriptionMessage(byte[] data) The public constructor of a Message taking raw message data. -
Method Summary
-
Constructor Details
-
Message
public Message(byte[] data) The public constructor of a Message taking raw message data. The message header is analysed to determine the type and therefore the priority.- Parameters:
data- the binary data
-
-
Method Details
-
getData
public byte[] getData()Returns the raw data- Returns:
- the raw data
-
getStringData
Returns the data as a string- Returns:
- the data as a string
-
getType
Returns the message type- Returns:
- the message type
-
compareTo
Comparison function. Lower numbers are considered more important. If two messages with identical priorities, the timestamp is used (older message more important).- Specified by:
compareToin interfaceComparable<Message>- Parameters:
msg- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-