| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.comm
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 |
|
public void |
|
public void |
|
public void |
|
public void |
|
public void |
|
| Method Summary |
|
add(Byte elems, Integer where) |
|
add(Byte elems, Integer offset, Integer length) |
|
add(ByteBuffer elems, Integer where) |
|
|
|
|
public ByteBuffer |
|
private void |
|
|
|
public boolean |
|
public byte |
|
public byte[] |
|
public byte[] |
|
public Object |
|
public int |
|
public int |
|
public void |
set(Integer index, Byte element) |
public void |
|
public void |
|
public void |
|
public void |
|
public byte[] |
subArray(Integer from, Integer length, Integer capacity, Boolean inFront) |
public byte[] |
|
public String |
|
private final static String className
Final.
Multiplicity:
1
Static.
byte[] data
private byte[] data
Multiplicity:
1
private static Logger logger
Multiplicity:
1
Static.
Object originator
private Object originator
Multiplicity:
1
private int size
Multiplicity:
1
int size
public void Message (Byte datum, Object orig)
Stereotype:
create
public void Message (Message message)
Stereotype:
create
public void Message (Byte datum)
Stereotype:
create
Custom properties
pre:
data != null
public void Message ()
Stereotype:
create
public void Message (Integer initialCapacity)
Constructs an empty message of the initialCapacity size
Parameters:
initialCapacity
Stereotype:
create
Custom properties
pre:
initialCapacity != null
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
public Message add (Byte elems, Integer where)
Appends the specified elements at the "where" position
Parameters:
elems
byte[]
where
int
Return:
Message
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.
public Message add (ByteBuffer elems, Integer where)
Appends the elements form the ByteBuffer at the "where" position
Parameters:
elems
where
Return:
Message
public Message add (ByteBuffer datum)
Appends the remaining buffer elements to the end of this list.
Parameters:
datum
ByteBuffer
Return:
Message
Appends the specified elements to the end of this list.
Parameters:
datum
Message
Return:
Message
public ByteBuffer asByteBuffer ()
Returns a buffer SHARING elements with the receiver.
Return:
ByteBuffer
private void checkIndex (Integer index)
Checks if the given index is in range.
Parameters:
index
int
Constructs and returns a new list that is a deep copy of the receiver.
Return:
a deep copy of the receiver.
public boolean equals (Object rhs)
public byte get (Integer index)
Returns the element at the specified index.
Parameters:
index
index of element to return.
public byte[] getAndTrim (Integer length)
Returns "length" elements from the begining of the array and trims them
Parameters:
length
int
Return:
byte[]
public byte[] getData ()
Returns the actual data contained in the message.
Return:
byte[]
public Object getOriginator ()
Return:
Returns the originator.
public int getSize ()
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.
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
public void setCapacity (Integer minCapacity, Boolean where)
Sets the capacity of the message to whichever is bigger, minCapacity or
data.length
Parameters:
minCapacity
int
public void setData (Byte datum)
Assigns the actual data of the message
Parameters:
datum
byte[]
public void setOriginator (Object orig)
Parameters:
orig
The originator to set.
public void setSize (Integer newSize)
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[]
public byte[] toArray ()
Returns the array representation of the message
Return:
byte[]
public String toString ()
Outside representation of the message
Return:
String
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|