Class SequenceNumber
- java.lang.Object
- 
- java.lang.Number
- 
- org.apache.qpid.protonj2.engine.util.SequenceNumber
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<SequenceNumber>
 
 public class SequenceNumber extends Number implements Comparable<SequenceNumber> A mutable sequence that represents an unsigned integer type underneath- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description SequenceNumber(int startValue)Create a new sequence starting at the given value.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(int other)Compares the sequence number value to the primitiveIntegergiven.intcompareTo(Number other)Compares the sequence number value to theNumbergiven.intcompareTo(SequenceNumber other)SequenceNumberdecrement()Subtract one to the sequence value.doubledoubleValue()booleanequals(int other)Performs an unsigned comparison between the current sequence number and the integer value passed.booleanequals(Object other)floatfloatValue()SequenceNumbergetAndDecrement()Subtract one to the sequence value.SequenceNumbergetAndIncrement()Add one to the sequence value.inthashCode()SequenceNumberincrement()Add one to the sequence value.intintValue()longlongValue()StringtoString()- 
Methods inherited from class java.lang.NumberbyteValue, shortValue
 
- 
 
- 
- 
- 
Method Detail- 
incrementpublic SequenceNumber increment() Add one to the sequence value.- Returns:
- this sequence.
 
 - 
decrementpublic SequenceNumber decrement() Subtract one to the sequence value.- Returns:
- this sequence.
 
 - 
getAndIncrementpublic SequenceNumber getAndIncrement() Add one to the sequence value.- Returns:
- this sequence value prior to the increment.
 
 - 
getAndDecrementpublic SequenceNumber getAndDecrement() Subtract one to the sequence value.- Returns:
- this sequence value prior to the decrement.
 
 - 
floatValuepublic float floatValue() - Specified by:
- floatValuein class- Number
 
 - 
doubleValuepublic double doubleValue() - Specified by:
- doubleValuein class- Number
 
 - 
compareTopublic int compareTo(SequenceNumber other) - Specified by:
- compareToin interface- Comparable<SequenceNumber>
 
 - 
compareTopublic int compareTo(Number other) Compares the sequence number value to theNumbergiven. This method returns 0 if the tracked id is equal to the value provided, value less than 0 if the tracked id is less than the provided value; and a value greater than 0 if the tracked id is larger than the value provided.- Parameters:
- other- The- Numberto compare the current sequence number with.
- Returns:
- the result of comparing the current sequence number to the provided number.
 
 - 
compareTopublic int compareTo(int other) Compares the sequence number value to the primitiveIntegergiven. This method returns 0 if the tracked id is equal to the value provided, value less than 0 if the tracked id is less than the provided value; and a value greater than 0 if the tracked id is larger than the value provided.- Parameters:
- other- The- Numberto compare the current sequence number with.
- Returns:
- the result of comparing the current sequence number to the provided number.
 
 - 
equalspublic boolean equals(int other) Performs an unsigned comparison between the current sequence number and the integer value passed.- Parameters:
- other- The value to compare to the currently sequence number.
- Returns:
- true if the currently sequence value matches the integer value provided.
 
 
- 
 
-