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

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

public class TimeManagedPacketList
extends java.lang.Object

The time managed list takes any number of packets as input. It assumes the packets are in time order. A span of time is then used to request packets from the list. The returned packet either match or encapsulate the request. If the request can not be met, four conditions may occur: 1 - the timespan cannot be fulfilled for the beginning time, but can for the ending time 2 - the timespan cannot be fulfilled for the ending time, but can for the beginning time 4 - the timespan cannot be fulfilled for either time 5 - the timespan can be fulfilled for both times One the request has been processed the list requested is returned along with the return code status as described above...


Field Summary
private  java.util.List<Packet> packetList
           
 
Constructor Summary
TimeManagedPacketList(java.util.List<Packet> packets)
          Create a TimeManagedPacketList from a list of input packets
 
Method Summary
private  int compare(long firstTimeIET, long secondTimeIET)
           
 TimeSpanPacketList get(long beginningTimeIET, long endingTimeIET)
          Given packet times in IET format as a 64-bit quantity, find the encapsulating list of packets from the internal list.
private  int getIndexOnOrAfter(long endingTimeIET)
           
private  int getIndexOnOrBefore(long beginningTimeIET)
           
 int size()
          The size of the internal list of packets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packetList

private java.util.List<Packet> packetList
Constructor Detail

TimeManagedPacketList

public TimeManagedPacketList(java.util.List<Packet> packets)
Create a TimeManagedPacketList from a list of input packets

Parameters:
packets - the input packets
Method Detail

size

public int size()
The size of the internal list of packets

Returns:
the number of packets

get

public TimeSpanPacketList get(long beginningTimeIET,
                              long endingTimeIET)
Given packet times in IET format as a 64-bit quantity, find the encapsulating list of packets from the internal list. The the beginning packet found must be either of the same time as the specified beginningTime below, or before it. And the ending packet found must be either of the same time or after it. These should be the closest before/after times in the list.

Parameters:
beginningTimeIET - the 64-bit beginning packet time in IET format
endingTimeIET - the 64-bit ending packet time in IET format
Returns:
a TimeSpanPacketList object that contains the list of packets that meet the criteria in some way as specified by the code

getIndexOnOrAfter

private int getIndexOnOrAfter(long endingTimeIET)

getIndexOnOrBefore

private int getIndexOnOrBefore(long beginningTimeIET)

compare

private int compare(long firstTimeIET,
                    long secondTimeIET)