gov.nasa.gsfc.drl.rtstps.core.ccsds.path
Class PacketList

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.ccsds.path.PacketList

final class PacketList
extends java.lang.Object

This class manages a sequential list of packets to be filled. It reuses its Packet objects, so subsequent users must not cache them.


Field Summary
private  Packet currentPacket
           
private  int currentPacketIndex
           
private  boolean isPartialCurrentPacket
           
private  java.util.ArrayList<Packet> packetList
           
 
Constructor Summary
PacketList()
           
 
Method Summary
(package private)  void flushAllData()
          Reset the packet list so it contains no full or partial packets.
(package private)  void flushCompletedPackets()
          Remove all completed packets from the list but keep the last partial one if it exists.
(package private)  Packet get(int packetLength)
          Get the next packet to fill from the packet list.
(package private)  Packet[] getList()
          Get a list of completed packets in time order.
(package private)  void setCurrentPacketIsComplete()
          Mark that the current packet, which was last obtained via get(), as a completed one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packetList

private java.util.ArrayList<Packet> packetList

currentPacket

private Packet currentPacket

currentPacketIndex

private int currentPacketIndex

isPartialCurrentPacket

private boolean isPartialCurrentPacket
Constructor Detail

PacketList

PacketList()
Method Detail

get

Packet get(int packetLength)
Get the next packet to fill from the packet list.

Parameters:
packetLength - The length of the desired packet.
Returns:
A packet to fill

setCurrentPacketIsComplete

final void setCurrentPacketIsComplete()
Mark that the current packet, which was last obtained via get(), as a completed one.


flushAllData

final void flushAllData()
Reset the packet list so it contains no full or partial packets.


flushCompletedPackets

void flushCompletedPackets()
Remove all completed packets from the list but keep the last partial one if it exists.


getList

Packet[] getList()
Get a list of completed packets in time order.

Returns:
null if there are no completed packets in the list.