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

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

public class RandomAccessPacketReader
extends java.lang.Object

Using the StaticHeader of a particular RawApplicationPackets item, read the contents using a random access style interface. This class used the various fields in the StaticHeader to access the packets held in the packet region. Note that this classes constructor is package private, and a method in each StaticHeader must be used to create it.


Field Summary
private  ApStorageArea apStorageArea
           
private  PacketTrackerList packetTrackerList
           
private  PacketFactoryI pf
           
private  int position
           
private  RDRAppIdList rdrAppIdList
           
private  boolean state
           
private  StaticHeader staticHeader
           
 
Constructor Summary
RandomAccessPacketReader(PacketFactoryI packetFactory, StaticHeader staticHeader)
          Make a new reader by providing PacketFactory (some way to create new Packets) and the StaticHeader of interest
 
Method Summary
 void close()
          Close the AppId reader...
private  void next(int appId)
           
 int open()
          Open the StaticHeader
 int open(int appId)
          Open the StaticHeader
 java.util.List<Packet> readNext()
          Read next current position and increment to the next position
 java.util.List<Packet> readNext(int appId)
          Read the AppId from the current position and increment to the next position
 void reset()
          Reset the list back to zero
 int size()
          Return the size or really number count of entries in the RDR Apid List that match appId
 int size(int appId)
          Return the size or really number count of entries in the RDR Apid List that match appId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pf

private PacketFactoryI pf

staticHeader

private StaticHeader staticHeader

rdrAppIdList

private RDRAppIdList rdrAppIdList

packetTrackerList

private PacketTrackerList packetTrackerList

apStorageArea

private ApStorageArea apStorageArea

position

private int position

state

private boolean state
Constructor Detail

RandomAccessPacketReader

RandomAccessPacketReader(PacketFactoryI packetFactory,
                         StaticHeader staticHeader)
Make a new reader by providing PacketFactory (some way to create new Packets) and the StaticHeader of interest

Parameters:
packetFactory - a way to create new Packets
staticHeader - the StaticHeader from a RawApplicationsPackets of interest
Method Detail

next

private void next(int appId)

open

public int open()
         throws RtStpsException
Open the StaticHeader

Throws:
RtStpsException

open

public int open(int appId)
         throws RtStpsException
Open the StaticHeader

Throws:
RtStpsException

readNext

public java.util.List<Packet> readNext(int appId)
                                throws RtStpsException
Read the AppId from the current position and increment to the next position

Parameters:
appId - the application identifier of interest
Returns:
the number of packets for AppId read or zero if at EOP
Throws:
RtStpsException

readNext

public java.util.List<Packet> readNext()
                                throws RtStpsException
Read next current position and increment to the next position

Returns:
the number of packets for AppId read or zero if at EOP
Throws:
RtStpsException

size

public int size(int appId)
         throws RtStpsException
Return the size or really number count of entries in the RDR Apid List that match appId

Returns:
the number of RDR Apist List entries for the apid
Throws:
RtStpsException

size

public int size()
         throws RtStpsException
Return the size or really number count of entries in the RDR Apid List that match appId

Returns:
the number of RDR Apist List entries for the apid
Throws:
RtStpsException

reset

public void reset()
Reset the list back to zero


close

public void close()
Close the AppId reader...