gov.nasa.gsfc.drl.rtstps.core.xstps.pds
Class Sequencer

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.xstps.pds.Sequencer

final class Sequencer
extends java.lang.Object

This class checks for packet sequence errors.


Field Summary
private  int count
          The current correct count.
private  int expectedCount
           
private  boolean firstTime
           
private static int MASK
           
private  int stepsize
           
 
Constructor Summary
Sequencer(int step)
          Create s Sequencer with a non-zero stepsize.
 
Method Summary
(package private)  int check(Packet packet)
          Check a packet for a sequence error.
(package private)  int getExpectedNextCount()
          Get the next expected sequence count.
private  int getGapWithUnusualStepsize(int actual, int expected, int step)
          In this function I compute the gap assuming the step value > 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

private int count
The current correct count.


MASK

private static int MASK

stepsize

private int stepsize

firstTime

private boolean firstTime

expectedCount

private int expectedCount
Constructor Detail

Sequencer

Sequencer(int step)
Create s Sequencer with a non-zero stepsize.

Method Detail

getExpectedNextCount

final int getExpectedNextCount()
Get the next expected sequence count.


check

int check(Packet packet)
Check a packet for a sequence error. Note that this class uses the first packet it sees to establish a sequence seed.


getGapWithUnusualStepsize

private int getGapWithUnusualStepsize(int actual,
                                      int expected,
                                      int step)
In this function I compute the gap assuming the step value > 1. I do step < -1 by calling it with actual and expectedCount swapped.