org.apache.qpid.util
Class Serial

java.lang.Object
  extended by org.apache.qpid.util.Serial

public class Serial
extends Object

This class provides basic serial number comparisons as defined in RFC 1982.


Field Summary
static Comparator<Integer> COMPARATOR
           
 
Constructor Summary
Serial()
           
 
Method Summary
static int compare(int s1, int s2)
          Compares two numbers using serial arithmetic.
static boolean eq(int s1, int s2)
           
static boolean ge(int s1, int s2)
           
static boolean gt(int s1, int s2)
           
static boolean le(int s1, int s2)
           
static boolean lt(int s1, int s2)
           
static int max(int s1, int s2)
           
static int min(int s1, int s2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARATOR

public static final Comparator<Integer> COMPARATOR
Constructor Detail

Serial

public Serial()
Method Detail

compare

public static final int compare(int s1,
                                int s2)
Compares two numbers using serial arithmetic.

Parameters:
s1 - the first serial number
s2 - the second serial number
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second

lt

public static final boolean lt(int s1,
                               int s2)

le

public static final boolean le(int s1,
                               int s2)

gt

public static final boolean gt(int s1,
                               int s2)

ge

public static final boolean ge(int s1,
                               int s2)

eq

public static final boolean eq(int s1,
                               int s2)

min

public static final int min(int s1,
                            int s2)

max

public static final int max(int s1,
                            int s2)


Licensed to the Apache Software Foundation