RTPpublic class RTP extends Object Neon Standard Utilities
RTP Utilities |
Fields Summary |
---|
private static int | MAX_SEQ_NUM |
Methods Summary |
---|
public static boolean | areConsecutiveSequenceNumbers(long numOne, long numTwo)
if (numOne == MAX_SEQ_NUM && numTwo == 0) return true;
if (numOne+1 == numTwo) return true;
return false;
| public static int | compareSequenceNumbers(long p, long c)
// Allow for the case where sequence number has wrapped.
if (p > MAX_SEQ_NUM - 100 && c < 100) return 1;
if (c > MAX_SEQ_NUM - 100 && p < 100) return -1;
if (p < c) return -1;
if (p == c) return 0;
return 1;
| public static long | nextSequenceNumber(long seq)
if (seq == MAX_SEQ_NUM) return 0;
return seq+1;
| public static long | previousSequenceNumber(long seq)
if (seq == 0) return MAX_SEQ_NUM;
return seq-1;
|
|