gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class RDRAppIdItem

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.RDRAppIdItem

public class RDRAppIdItem
extends java.lang.Object

Read of write the AppIdItem from or to a StaticHeader


Field Summary
private  byte[] data
           
private  java.lang.String name
           
private  int offset
           
private  int pktsReceived
           
private  int pktsReserved
           
private  int pktTrackerIndex
           
private static int size
           
private  int value
           
 
Constructor Summary
RDRAppIdItem(byte[] data, int offset)
          Constructor to create an RDRAppIdItem from a memory buffer, likely read from an HDF file.
RDRAppIdItem(int appId, int pktTrackerIndex, int pktsReceived)
          Constructor to create an RDRAppIdItem from passed in values, likely to be written to a memory buffer as define by the write() method, and then eventually to an HDF file.
 
Method Summary
static int getHDFSize()
          Return the AppIdItem's size which is fixed
 java.lang.String getName()
          Return the name
 int getPktsReceived()
          Return the pktsReceived field
 int getPktsReserved()
          Return the pktsReserved field
 int getPktTrackerIndex()
          Return the pktTrackerIndex
 int getValue()
          Return the value
private  void readName()
          Read the name from a buffer to an internal field
private  void readPkstReceived()
          Read the pktsReceived from a buffer to an internal field
private  void readPktsReserved()
          Read the pktsReserved from a buffer to an internal field
private  void readPktTrackerIndex()
          Read the pktTrackerIndex from a buffer to an internal field
private  void readValue()
          Read the value from a buffer to an internal field
 int write(byte[] data, int offset)
          Write the contents of this object's fields to the specified data buffer, return the new offset
private  void writeName()
          Write the name (the name associate with the application ID).
private  void writePkstReceived()
          Write the pktsReceived, it is copied to a buffer.
private  void writePktsReserved()
          Write the pktsReserved, it is copied to a buffer.
private  void writePktTrackerIndex()
          Write the pktTrackerIndex, it is copied to a buffer.
private  void writeValue()
          Write the value, it is copied to a buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

value

private int value

pktTrackerIndex

private int pktTrackerIndex

pktsReserved

private int pktsReserved

pktsReceived

private int pktsReceived

size

private static final int size
See Also:
Constant Field Values

data

private byte[] data

offset

private int offset
Constructor Detail

RDRAppIdItem

public RDRAppIdItem(int appId,
                    int pktTrackerIndex,
                    int pktsReceived)
Constructor to create an RDRAppIdItem from passed in values, likely to be written to a memory buffer as define by the write() method, and then eventually to an HDF file. This then is the "write" side of this class.

Parameters:
appId - the value field
pktTrackerIndex - the packet tracker index
pktsReceived - the packets received

RDRAppIdItem

public RDRAppIdItem(byte[] data,
                    int offset)
Constructor to create an RDRAppIdItem from a memory buffer, likely read from an HDF file. This then is the "read" side of this class. Once created each field will be populated from the data in the supplied buffer and accessible by the methods below. The data buffer is not synchronized to these fields however, any changes to it are NOT reflected here after the constructor has been called

Parameters:
data - byte array that holds the data
offset - the offset into the array
Method Detail

write

public int write(byte[] data,
                 int offset)
Write the contents of this object's fields to the specified data buffer, return the new offset

Parameters:
data - the data buffer to be written to
offset - the offset into the buffer
Returns:
int the number of bytes written (its fixed at the defined HDF size)s

getName

public java.lang.String getName()
Return the name

Returns:
the name in the String

getValue

public int getValue()
Return the value

Returns:
the value as an int

getPktTrackerIndex

public int getPktTrackerIndex()
Return the pktTrackerIndex

Returns:
the pktTrackerIndex as an int

getPktsReserved

public int getPktsReserved()
Return the pktsReserved field

Returns:
the pktsReserved as an int

getPktsReceived

public int getPktsReceived()
Return the pktsReceived field

Returns:
the pktsReceived as an int

getHDFSize

public static int getHDFSize()
Return the AppIdItem's size which is fixed

Returns:
the size as an int

writeName

private void writeName()
Write the name (the name associate with the application ID). It is copied to a buffer.


writeValue

private void writeValue()
Write the value, it is copied to a buffer.


writePktTrackerIndex

private void writePktTrackerIndex()
Write the pktTrackerIndex, it is copied to a buffer.


writePktsReserved

private void writePktsReserved()
Write the pktsReserved, it is copied to a buffer.


writePkstReceived

private void writePkstReceived()
Write the pktsReceived, it is copied to a buffer.


readName

private void readName()
Read the name from a buffer to an internal field


readValue

private void readValue()
Read the value from a buffer to an internal field


readPktTrackerIndex

private void readPktTrackerIndex()
Read the pktTrackerIndex from a buffer to an internal field


readPktsReserved

private void readPktsReserved()
Read the pktsReserved from a buffer to an internal field


readPkstReceived

private void readPkstReceived()
Read the pktsReceived from a buffer to an internal field