Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.comm
Class Message
Direct Known Subclasses:
       RttMessage

public class Message      
 
 

Field Summary
byte[]
int
Object
private final static String
private byte[]
private static Logger
private Object
private int
Constructor Summary
public void
Message(Byte datum, Object orig)
public void
Message(Message message)
public void
Message(Byte datum)
public void
public void
Message(Integer initialCapacity)
public void
Message(ByteBuffer buffer)
Method Summary
public Message
add(Byte elems, Integer where)
public Message
add(Byte elems, Integer offset, Integer length)
public Message
add(ByteBuffer elems, Integer where)
public Message
add(ByteBuffer datum)
public Message
add(Message datum)
public ByteBuffer
private void
checkIndex(Integer index)
public Message
public boolean
equals(Object rhs)
public byte
get(Integer index)
public byte[]
getAndTrim(Integer length)
public byte[]
public Object
public int
public int
public void
set(Integer index, Byte element)
public void
setCapacity(Integer minCapacity, Boolean where)
public void
setData(Byte datum)
public void
setOriginator(Object orig)
public void
setSize(Integer newSize)
public byte[]
subArray(Integer from, Integer length, Integer capacity, Boolean inFront)
public byte[]
public String
Field Detail
className
private final static String className
Final.
Multiplicity:
1
Static.
 

data
byte[] data
 

data
private byte[] data
Multiplicity:
1
 

logger
private static Logger logger
Multiplicity:
1
Static.
 

originator
Object originator
 

originator
private Object originator
Multiplicity:
1
 

size
private int size
Multiplicity:
1
 

size
int size
 
Constructor Detail
Message
public void Message (Byte datum, Object orig)
 
Stereotype:
create
 

Message
public void Message (Message message)
 
Stereotype:
create
 

Message
public void Message (Byte datum)
 
Stereotype:
create
Custom properties
pre:
data != null
 

Message
public void Message ()
 
Stereotype:
create
 

Message
public void Message (Integer initialCapacity)
 
Constructs an empty message of the initialCapacity size
Parameters:
initialCapacity
Stereotype:
create
Custom properties
pre:
initialCapacity != null
 

Message
public void Message (ByteBuffer buffer)
 
Constructs a message by copying the bytebuffer into the message. If
buffer is null it constructs an emty default message
Parameters:
buffer
Stereotype:
create
 
Method Detail
add
public Message add (Byte elems, Integer where)
 
Appends the specified elements at the "where" position
Parameters:
elems
byte[]
where
int
Return:
Message
 

add
public Message add (Byte elems, Integer offset, Integer length)
 
Appends the elements in the range [offset..offset+length)
to the end of this list.

throws IndexOutOfBoundsException if indexes are out of range.
 

add
public Message add (ByteBuffer elems, Integer where)
 
Appends the elements form the ByteBuffer at the "where" position
Parameters:
elems
where
Return:
Message
 

add
public Message add (ByteBuffer datum)
 
Appends the remaining buffer elements to the end of this list.
Parameters:
datum
ByteBuffer
Return:
Message
 

add
public Message add (Message datum)
 
Appends the specified elements to the end of this list.
Parameters:
datum
Message
Return:
Message
 

asByteBuffer
public ByteBuffer asByteBuffer ()
 
Returns a buffer SHARING elements with the receiver.
Return:
ByteBuffer
 

checkIndex
private void checkIndex (Integer index)
 
Checks if the given index is in range.
Parameters:
index
int
 

copy
public Message copy ()
 
Constructs and returns a new list that is a deep copy of the receiver.
Return:
a deep copy of the receiver.
 

equals
public boolean equals (Object rhs)
 
 

get
public byte get (Integer index)
 
Returns the element at the specified index.
Parameters:
index
index of element to return.
 

getAndTrim
public byte[] getAndTrim (Integer length)
 
Returns "length" elements from the begining of the array and trims them
Parameters:
length
int
Return:
byte[]
 

getData
public byte[] getData ()
 
Returns the actual data contained in the message.
Return:
byte[]
 

getOriginator
public Object getOriginator ()
 
Return:
Returns the originator.
 

getSize
public int getSize ()
 
 

hashCode
public int hashCode ()
 
Returns the hash code value for this list. The algorithm ensures that
message1.equals(message2) implies that
message1.hashCode()==message2.hashCode() for any two
messages, message1 and message2, as
required by the general contract of Object.hashCode.
 

set
public void set (Integer index, Byte element)
 
Replaces the element at the specified index with the specified element.
Parameters:
index
int
element
byte

throws IndexOutOfBoundsException
 

setCapacity
public void setCapacity (Integer minCapacity, Boolean where)
 
Sets the capacity of the message to whichever is bigger, minCapacity or
data.length
Parameters:
minCapacity
int
 

setData
public void setData (Byte datum)
 
Assigns the actual data of the message
Parameters:
datum
byte[]
 

setOriginator
public void setOriginator (Object orig)
 
Parameters:
orig
The originator to set.
 

setSize
public void setSize (Integer newSize)
 
 

subArray
public byte[] subArray (Integer from, Integer length, Integer capacity, Boolean inFront)
 
Constructs and returns a new byte[] of "capacity" starting with "from"
element for the given length. If the capacity is less then legth, the
elements are lost
Parameters:
from
int
length
int
capacity
int
Return:
byte[]
 

toArray
public byte[] toArray ()
 
Returns the array representation of the message
Return:
byte[]
 

toString
public String toString ()
 
Outside representation of the message
Return:
String
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD