Class Message

java.lang.Object
eu.ill.webx.model.Message
All Implemented Interfaces:
Comparable<Message>
Direct Known Subclasses:
Message.CloseMessage, Message.InterruptMessage

public class Message extends Object implements Comparable<Message>
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).
  • 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

      public String getStringData()
      Returns the data as a string
      Returns:
      the data as a string
    • getType

      public Message.Type getType()
      Returns the message type
      Returns:
      the message type
    • compareTo

      public int compareTo(Message msg)
      Comparison function. Lower numbers are considered more important. If two messages with identical priorities, the timestamp is used (older message more important).
      Specified by:
      compareTo in interface Comparable<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.