|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.core.output.hdf5.PacketTrackerItem
public class PacketTrackerItem
The packet tracker item is part of the header in the RawApplicationPackets area. This class manages ne of these items, it can be either to create a PacketTrackerItem or it can be used to read one from a pre-existing file.
Field Summary | |
---|---|
private int |
appId
|
private int |
count
|
private byte[] |
data
|
private int |
fillPercent
|
private int |
hdfOffset
|
private long |
obsTime
|
private int |
offset
|
private int |
pktTrkr_size
|
private int |
sequenceNumber
|
private static int |
size
|
Constructor Summary | |
---|---|
PacketTrackerItem()
Constructor. |
|
PacketTrackerItem(byte[] data,
int offset)
Given an already filled memory buffer, retrieve values at the given offset to build the packet tracker items. |
|
PacketTrackerItem(long obsTime,
int sequenceNumber,
int size,
int hdfOffset,
int fillPercent)
Construct a new packet tracker item with the input values. |
Method Summary | |
---|---|
void |
addCount(int count)
Add to the count |
void |
addSize(int size)
Add to the packet tracker size |
int |
getAppId()
Get the packet application ID |
int |
getCount()
Get the count |
int |
getFillPercent()
Get the fill percentage |
static int |
getHDFSize()
The size is fixed, retrieve it for other reasons |
long |
getObsTime()
Get the observation time |
int |
getOffset()
Get the header offset |
int |
getSequenceNumber()
Get the sequence number |
int |
getSize()
Get the size of the pkt tracker |
private void |
readFillPercent()
Read the fill percentage from a data buffer passed in the in "read" constructor |
private void |
readObsTime()
Read the observation time from a data buffer passed in the in "read" constructor |
private void |
readOffset()
Read the offset from a data buffer passed in the in "read" constructor |
private void |
readSequenceNumber()
Read the sequence number from a data buffer passed in the in "read" constructor |
private void |
readSize()
Read the size from a data buffer passed in the in "read" constructor |
void |
setAppId(int appId)
Set the application id of the packet tracker |
void |
setCount(int count)
Set the count |
void |
setFillPercent(int fillPercent)
Set the fill percentage |
void |
setObsTime(long obsTime)
Set the observation time |
void |
setOffset(int hdfOffset)
Set the offset in the header |
void |
setSequenceNumber(int sequenceNumber)
Set the sequence number |
void |
setSize(int size)
Set the packet tracker size |
int |
write(byte[] data,
int offset)
Write the newly constructed PacketTrackerItem information to the data array given |
private void |
writeFillPercent()
Serialize the fill percent into the data array |
private void |
writeObsTime()
Serialize the observation time into the data array |
private void |
writeOffset()
Serialize the offset into the data array |
private void |
writeSequenceNumber()
Serialize the sequence number into the data array |
private void |
writeSize()
Serialize the size into the data array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private long obsTime
private int sequenceNumber
private int pktTrkr_size
private int hdfOffset
private int fillPercent
private static final int size
private int count
private int appId
private byte[] data
private int offset
Constructor Detail |
---|
public PacketTrackerItem(long obsTime, int sequenceNumber, int size, int hdfOffset, int fillPercent)
obsTime
- the observation timesequenceNumber
- the sequence numbersize
- the size of the packet trackerhdfOffset
- the offset in the headerfillPercent
- the fill percentage which is fixed for DRL/field terminal at this timepublic PacketTrackerItem()
public PacketTrackerItem(byte[] data, int offset)
data
- offset
- Method Detail |
---|
public void setObsTime(long obsTime)
obsTime
- the observation time in 64-bitspublic void setSequenceNumber(int sequenceNumber)
sequenceNumber
- the sequence numberpublic void setSize(int size)
size
- the sizepublic void addSize(int size)
size
- this is used when...public void setOffset(int hdfOffset)
hdfOffset
- the offset in bytespublic void setFillPercent(int fillPercent)
fillPercent
- the fill percentagepublic void setCount(int count)
count
- public void addCount(int count)
count
- public void setAppId(int appId)
appId
- public long getObsTime()
public int getSequenceNumber()
public int getSize()
public int getOffset()
public int getFillPercent()
public int getAppId()
int
public int getCount()
public static int getHDFSize()
public int write(byte[] data, int offset)
data
- the byte array the packet tracker information should be packed intooffset
- the offset in bytes into the array
private void writeObsTime()
private void writeSequenceNumber()
private void writeSize()
private void writeOffset()
private void writeFillPercent()
private void readObsTime()
private void readSequenceNumber()
private void readSize()
private void readOffset()
private void readFillPercent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |