com.msi.comms.bytebuffer
Class BufferCell

java.lang.Object
  |
  +--com.msi.comms.bytebuffer.BufferCell
All Implemented Interfaces:
java.io.Serializable

public class BufferCell
extends java.lang.Object
implements java.io.Serializable

Describe class BufferCell here.

Version:
1.0
Author:
Ken Thompson
See Also:
Serialized Form

Field Summary
private  int length
           
private  java.lang.String name
           
private  int offset
           
 
Constructor Summary
BufferCell(int offset, int length)
          Creates a new BufferCell instance.
BufferCell(int offset, int length, java.lang.String name)
          Creates a new BufferCell instance.
 
Method Summary
 byte[] getBytes(byte[] buffer)
          getBytes retrieve the bytes associated with this Cell from the supplied byte array.
 int getLength()
          Get the value of length.
 java.lang.String getName()
          Get the value of name.
 int getOffset()
          Get the value of offset.
 java.lang.String getString(byte[] buffer)
          getString retrieve the Cell as a String from the supplied buffer.
 void setBytes(byte[] buffer, byte[] val)
          setBytes copy the supplied bytes into the supplied byte array.
 void setLength(int v)
          Set the value of length.
 void setName(java.lang.String v)
          Set the value of name.
 void setOffset(int v)
          Set the value of offset.
 void setString(byte[] buffer, java.lang.String val)
          setString set the Cell data in the supplied buffer from the supplied String.
 java.lang.String toString()
          toString presentation of the class state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

private int offset

length

private int length

name

private java.lang.String name
Constructor Detail

BufferCell

public BufferCell(int offset,
                  int length)
Creates a new BufferCell instance.

Parameters:
offset - an int value
length - an int value

BufferCell

public BufferCell(int offset,
                  int length,
                  java.lang.String name)
Creates a new BufferCell instance.

Parameters:
offset - an int value
length - an int value
name - a String value
Method Detail

toString

public java.lang.String toString()
toString presentation of the class state.

Overrides:
toString in class java.lang.Object
Returns:
a String value

getBytes

public byte[] getBytes(byte[] buffer)
                throws java.lang.Exception
getBytes retrieve the bytes associated with this Cell from the supplied byte array.

Parameters:
buffer - a byte[] containing this cell.
Returns:
a byte[] with the value of this cell.
Throws:
java.lang.Exception - if an error occurs, generally index out of range due to an undersized buffer.

setBytes

public void setBytes(byte[] buffer,
                     byte[] val)
              throws java.lang.Exception
setBytes copy the supplied bytes into the supplied byte array.

Parameters:
buffer - a byte[] to contain the supplied value.
val - a byte[] with values to copy to the buffer.
Throws:
java.lang.Exception - if an error occurs, usually out of bounds exception because the buffer is too small or the val length is less than the Cell length.

getString

public java.lang.String getString(byte[] buffer)
                           throws java.lang.Exception
getString retrieve the Cell as a String from the supplied buffer.

Parameters:
buffer - a byte[] containing the Cell data.
Returns:
a String representation of the Cell.
Throws:
java.lang.Exception - if an error occurs.

setString

public void setString(byte[] buffer,
                      java.lang.String val)
               throws java.lang.Exception
setString set the Cell data in the supplied buffer from the supplied String.

Parameters:
buffer - a byte[] containing the Cell data.
val - a String containing the new values.
Throws:
java.lang.Exception - if an error occurs.

getLength

public int getLength()
Get the value of length.

Returns:
value of length.

setLength

public void setLength(int v)
Set the value of length.

Parameters:
v - Value to assign to length.

getOffset

public int getOffset()
Get the value of offset.

Returns:
value of offset.

setOffset

public void setOffset(int v)
Set the value of offset.

Parameters:
v - Value to assign to offset.

getName

public java.lang.String getName()
Get the value of name.

Returns:
value of name.

setName

public void setName(java.lang.String v)
Set the value of name.

Parameters:
v - Value to assign to name.


Copyright © 2002 Cingular. All Rights Reserved.