1.0.0

org.eclipse.soda.dk.message
Class Message

java.lang.Object
  extended by org.eclipse.soda.dk.message.Message
All Implemented Interfaces:
java.lang.Cloneable, MessageService
Direct Known Subclasses:
AsciiMessage, FilterMessage, SimpleResponseMessage, UdpMessage

public class Message
extends java.lang.Object
implements MessageService, java.lang.Cloneable

The Message class implements the MessageService interface.

Version:
1.0.0
See Also:
EscObject, Cloneable, MessageService, ParameterService

Field Summary
 
Fields inherited from interface org.eclipse.soda.dk.message.service.MessageService
HIGH_PRIORITY, LOW_PRIORITY, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, STRING, THREAD_PRIORITY
 
Constructor Summary
Message()
          Constructs a standard Message object.
Message(byte[] data)
          Constructs an Message object using the input parameter(s).
Message(byte[] data, int offset, int length)
          Constructs an Message object using the input parameter(s).
Message(java.lang.String data)
          Constructs an Message object using the input parameter(s).
 
Method Summary
 java.lang.Object clone()
          Perform the clone method and return the Object result.
 java.lang.Object decodeMessage(MessageService message)
          Perform the decodeValue method and return the Object result.
 java.lang.Object decodeMessage(MessageService message, ParameterService parameter)
          Perform the decodeValue method and return the Object result.
 MessageService encodeMessage(MessageService message, java.lang.Object value)
          Perform the encodeValue method and return the MessageService result.
 MessageService encodeMessage(MessageService message, ParameterService parameter, java.lang.Object value)
          Perform the encodeValue method and return the MessageService result.
 boolean equals(java.lang.Object object)
           
 java.lang.Object get(java.lang.Object key)
          Perform the get method and return the Object result.
 boolean getBoolean(int offset)
          Perform the getBoolean method and return the boolean result.
 byte getByte(int offset)
          Perform the getByte method and return the byte result.
 byte[] getBytes()
          Gets the byte [] bytes property value.
 java.lang.Object getData()
          Gets the Object data property value.
 byte[] getDataBytes()
          Gets the data bytes.
 int getDataLength()
          Gets the data length (int) value.
 int getDataOffset()
          Gets the data offset (int) value.
 int getInt(int offset)
          Perform the getInt method and return the int result.
static int getIntByte(byte[] buffer, int offset)
          Perform the getIntByte method and return the int result.
 int getIntByte(int offset)
          Perform the getIntByte method and return the int result.
 java.lang.String getKey()
           
static long getLittleEndianInt(byte[] buffer, int offset)
          Perform the getLittleEndianInt method and return the long result.
static long getLittleEndianLong(byte[] buffer, int offset)
          Perform the getLittleEndianLong method and return the long result.
 long getLong(int offset)
          Perform the getLong method and return the long result.
static long getLongByte(byte[] buffer, int offset)
          Perform the getLongByte method and return the long result.
 long getLongByte(int offset)
          Perform the getLongByte method and return the long result.
 ParameterService getParameter()
          Gets the ParameterService parameter property value.
 int getPriority()
          Gets the int priority property value.
 short getShort(int offset)
          Perform the getShort method and return the short result.
 int hashCode()
          Hash code and return the int result.
 boolean isBigEndian()
          Gets the boolean bigEndian property value.
 int length()
          Perform the length method and return the int result.
 ParameterService lookup(ParameterService parameter)
          Lookup with the specified parameter parameter and return the ParameterService result.
 MessageService matches(MessageService message)
          Perform the matches method and return the boolean result.
 void put(java.lang.Object key, java.lang.Object value)
          Perform the put action method.
 void setBoolean(int offset, boolean value)
          Perform the setBoolean action method.
 void setByte(int offset, byte value)
          Perform the setByte action method.
 void setBytes(byte[] bytes)
          Sets the bytes property.
 void setData(java.lang.Object data)
          Sets the data property.
 void setInt(int offset, int value)
          Perform the setInt action method.
 void setLong(int offset, long value)
          Perform the setLong action method.
 void setShort(int offset, short value)
          Perform the setShort action method.
 java.lang.String toString()
          Perform the toString method and return the String result.
static java.lang.String toString(byte[] bytes)
          To string with the specified bytes parameter and return the String result.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Constructs a standard Message object.

See Also:
Message(byte[]), Message(byte[],int,int), Message(String), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

Message

public Message(byte[] data)
Constructs an Message object using the input parameter(s).

Parameters:
data - byte[]
See Also:
Message(), Message(byte[],int,int), Message(String), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

Message

public Message(byte[] data,
               int offset,
               int length)
Constructs an Message object using the input parameter(s).

Parameters:
data - byte[]
offset - int
length - int
See Also:
Message(), Message(byte[]), Message(String), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

Message

public Message(java.lang.String data)
Constructs an Message object using the input parameter(s).

Parameters:
data - java.lang.String
See Also:
Message(), Message(byte[]), Message(byte[],int,int), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)
Method Detail

getIntByte

public static int getIntByte(byte[] buffer,
                             int offset)
Perform the getIntByte method and return the int result.

Parameters:
buffer - byte[]
offset - int
Returns:
Results of the get int byte (int) value.
See Also:
getIntByte(int)

getLittleEndianInt

public static long getLittleEndianInt(byte[] buffer,
                                      int offset)
Perform the getLittleEndianInt method and return the long result.

Parameters:
buffer - byte[]
offset - int
Returns:
Results of the get little endian int (long) value.

getLittleEndianLong

public static long getLittleEndianLong(byte[] buffer,
                                       int offset)
Perform the getLittleEndianLong method and return the long result.

Parameters:
buffer - byte[]
offset - int
Returns:
Results of the get little endian long (long) value.

getLongByte

public static long getLongByte(byte[] buffer,
                               int offset)
Perform the getLongByte method and return the long result.

Parameters:
buffer - byte[]
offset - int
Returns:
Results of the get long byte (long) value.
See Also:
getLongByte(int)

toString

public static java.lang.String toString(byte[] bytes)
To string with the specified bytes parameter and return the String result.

Parameters:
bytes - The bytes (byte[]) parameter.
Returns:
Results of the to string (String) value.
See Also:
toString()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Perform the clone method and return the Object result.

Specified by:
clone in interface MessageService
Overrides:
clone in class java.lang.Object
Returns:
Results of the clone (Object) value.
Throws:
- href="java.lang.CloneNotSupportedException.html">CloneNotSupportedException Thrown if the CloneNotSupportedException exception condition occurs.
java.lang.CloneNotSupportedException
See Also:
MessageService.clone()

decodeMessage

public java.lang.Object decodeMessage(MessageService message)
Perform the decodeValue method and return the Object result.

Specified by:
decodeMessage in interface MessageService
Parameters:
message - The message (MessageService) parameter.
Returns:
Results of the decode message (Object) value.
See Also:
Message(), Message(byte[]), Message(byte[],int,int), Message(String), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

decodeMessage

public java.lang.Object decodeMessage(MessageService message,
                                      ParameterService parameter)
Perform the decodeValue method and return the Object result.

Specified by:
decodeMessage in interface MessageService
Parameters:
message - org.eclipse.soda.dk.message.service.MessageService
parameter - The parameter (ParameterService) parameter.
Returns:
Results of the decode message (Object) value.
See Also:
ParameterService.decodeValue(org.eclipse.soda.dk.message.service.MessageService), Message(), Message(byte[]), Message(byte[],int,int), Message(String), decodeMessage(MessageService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

encodeMessage

public MessageService encodeMessage(MessageService message,
                                    java.lang.Object value)
Perform the encodeValue method and return the MessageService result.

Specified by:
encodeMessage in interface MessageService
Parameters:
value - java.lang.Object
message - The message (MessageService) parameter.
Returns:
Results of the encode message (MessageService) value.
See Also:
ParameterService.encodeValue(org.eclipse.soda.dk.message.service.MessageService, java.lang.Object), Message(), Message(byte[]), Message(byte[],int,int), Message(String), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,ParameterService,Object)

encodeMessage

public MessageService encodeMessage(MessageService message,
                                    ParameterService parameter,
                                    java.lang.Object value)
Perform the encodeValue method and return the MessageService result.

Specified by:
encodeMessage in interface MessageService
Parameters:
message - org.eclipse.soda.dk.message.service.MessageService
value - java.lang.Object
parameter - The parameter (ParameterService) parameter.
Returns:
Results of the encode message (MessageService) value.
See Also:
ParameterService.encodeValue(org.eclipse.soda.dk.message.service.MessageService, java.lang.Object), Message(), Message(byte[]), Message(byte[],int,int), Message(String), decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object)

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object
Parameters:
o - The o (Object) parameter.
object - The object (Object) parameter.
Returns:
Results of the equals (boolean) value.
See Also:
Object.equals(Object)

get

public java.lang.Object get(java.lang.Object key)
Perform the get method and return the Object result.

Specified by:
get in interface MessageService
Parameters:
key - java.lang.Object
Returns:
Results of the get (Object) value.
See Also:
MessageService.get(java.lang.Object)

getBoolean

public boolean getBoolean(int offset)
Perform the getBoolean method and return the boolean result.

Parameters:
offset - int
Returns:
Results of the get boolean (boolean) value.
See Also:
setBoolean(int,boolean)

getByte

public byte getByte(int offset)
Perform the getByte method and return the byte result.

Specified by:
getByte in interface MessageService
Parameters:
offset - int
Returns:
Results of the get byte (byte) value.
See Also:
MessageService.getByte(int), getIntByte(byte[],int), getLongByte(byte[],int), getIntByte(int), getLongByte(int), setByte(int,byte)

getBytes

public byte[] getBytes()
Gets the byte [] bytes property value.

Specified by:
getBytes in interface MessageService
Returns:
Results of the get bytes (byte[]) value.
See Also:
MessageService.getBytes(), getDataBytes(), setBytes(byte[])

getData

public java.lang.Object getData()
Gets the Object data property value.

Returns:
Results of the get data (Object) value.
See Also:
setData(Object)

getDataBytes

public byte[] getDataBytes()
Gets the data bytes.

Specified by:
getDataBytes in interface MessageService
Returns:
Results of the get data bytes (byte[]) value.
See Also:
MessageService.getDataBytes()

getDataLength

public int getDataLength()
Gets the data length (int) value.

Specified by:
getDataLength in interface MessageService
Returns:
The data length (int) value.

getDataOffset

public int getDataOffset()
Gets the data offset (int) value.

Specified by:
getDataOffset in interface MessageService
Returns:
The data offset (int) value.

getInt

public int getInt(int offset)
Perform the getInt method and return the int result.

Parameters:
offset - int
Returns:
Results of the get int (int) value.
See Also:
getLittleEndianInt(byte[],int), setInt(int,int)

getIntByte

public int getIntByte(int offset)
Perform the getIntByte method and return the int result.

Parameters:
offset - int
Returns:
Results of the get int byte (int) value.
See Also:
getIntByte(byte[],int)

getKey

public java.lang.String getKey()
Returns:
Results of the get key (String) value.
See Also:
ParameterService.getKey()

getLong

public long getLong(int offset)
Perform the getLong method and return the long result.

Parameters:
offset - int
Returns:
Results of the get long (long) value.
See Also:
getLittleEndianLong(byte[],int), setLong(int,long)

getLongByte

public long getLongByte(int offset)
Perform the getLongByte method and return the long result.

Parameters:
offset - int
Returns:
Results of the get long byte (long) value.
See Also:
getLongByte(byte[],int)

getParameter

public ParameterService getParameter()
Gets the ParameterService parameter property value.

Returns:
Results of the get parameter (ParameterService) value.

getPriority

public int getPriority()
Gets the int priority property value.

Specified by:
getPriority in interface MessageService
Returns:
Results of the get priority (int) value.
See Also:
MessageService.getPriority()

getShort

public short getShort(int offset)
Perform the getShort method and return the short result.

Parameters:
offset - int
Returns:
Results of the get short (short) value.
See Also:
setShort(int,short)

hashCode

public int hashCode()
Hash code and return the int result.

Overrides:
hashCode in class java.lang.Object
Returns:
Results of the hash code (int) value.

isBigEndian

public boolean isBigEndian()
Gets the boolean bigEndian property value.

Returns:
Results of the is big endian (boolean) value.

length

public int length()
Perform the length method and return the int result.

Returns:
Results of the length (int) value.

lookup

public ParameterService lookup(ParameterService parameter)
Lookup with the specified parameter parameter and return the ParameterService result.

Specified by:
lookup in interface MessageService
Parameters:
parameter - The parameter (ParameterService) parameter.
Returns:
Results of the lookup (ParameterService) value.

matches

public MessageService matches(MessageService message)
Perform the matches method and return the boolean result.

Specified by:
matches in interface MessageService
Parameters:
message - org.eclipse.soda.dk.message.service.MessageService
Returns:
MessageService Returns any message that matches or NULL.
See Also:
MessageService.matches(org.eclipse.soda.dk.message.service.MessageService)

put

public void put(java.lang.Object key,
                java.lang.Object value)
Perform the put action method.

Specified by:
put in interface MessageService
Parameters:
key - java.lang.Object
value - java.lang.Object
See Also:
MessageService.put(java.lang.Object, java.lang.Object)

setBoolean

public void setBoolean(int offset,
                       boolean value)
Perform the setBoolean action method.

Parameters:
offset - int
value - boolean
See Also:
getBoolean(int)

setByte

public void setByte(int offset,
                    byte value)
Perform the setByte action method.

Specified by:
setByte in interface MessageService
Parameters:
offset - int
value - byte
See Also:
MessageService.setByte(int, byte), getIntByte(byte[],int), getLongByte(byte[],int), getByte(int), getIntByte(int), getLongByte(int)

setBytes

public void setBytes(byte[] bytes)
Sets the bytes property.

Specified by:
setBytes in interface MessageService
Parameters:
bytes - The new property value (byte[]).
See Also:
getBytes(), getDataBytes()

setData

public void setData(java.lang.Object data)
Sets the data property.

Parameters:
data - The data (Object) parameter.
See Also:
getData()

setInt

public void setInt(int offset,
                   int value)
Perform the setInt action method.

Parameters:
offset - int
value - int
See Also:
getLittleEndianInt(byte[],int), getInt(int)

setLong

public void setLong(int offset,
                    long value)
Perform the setLong action method.

Parameters:
offset - int
value - long
See Also:
getLittleEndianLong(byte[],int), getLong(int)

setShort

public void setShort(int offset,
                     short value)
Perform the setShort action method.

Parameters:
offset - int
value - short
See Also:
getShort(int)

toString

public java.lang.String toString()
Perform the toString method and return the String result.

Overrides:
toString in class java.lang.Object
Returns:
Results of the to string (String) value.
See Also:
toString(byte[])

1.0.0

Copyright (c) 1999, 2007 IBM