Class DeliveryIdTracker
java.lang.Object
java.lang.Number
org.apache.qpid.protonj2.engine.util.DeliveryIdTracker
- All Implemented Interfaces:
- Serializable,- Comparable<DeliveryIdTracker>
Tracker of Delivery ID values, implements a sequence number and provides ability to
 keep an not set state for use when allowing for set / not set tracking.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new Delivery Id tracker with initial state.DeliveryIdTracker(int startValue) Create a new Delivery Id tracker with initial state.
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(int other) Compares the tracked delivery id value to theintgiven, if no value is being tracked this method returns -1.intCompares the tracked delivery id value to theNumbergiven, if no value is being tracked this method returns -1.intcompareTo(DeliveryIdTracker other) doublebooleanequals(int other) Performs an unsigned comparison between the value being tracked and the integer value passed, if no id is currently being tracked then this method returns false.booleanfloatinthashCode()intintValue()booleanisEmpty()longvoidreset()Clears the tracked value and marks this tracker as empty.voidset(int value) Sets the current delivery ID value for thisDeliveryIdTrackertoString()Methods inherited from class java.lang.NumberbyteValue, shortValue
- 
Constructor Details- 
DeliveryIdTrackerpublic DeliveryIdTracker()Create a new Delivery Id tracker with initial state.
- 
DeliveryIdTrackerpublic DeliveryIdTracker(int startValue) Create a new Delivery Id tracker with initial state.- Parameters:
- startValue- The initial value to assign this tracker.
 
 
- 
- 
Method Details- 
setpublic void set(int value) Sets the current delivery ID value for thisDeliveryIdTracker- Parameters:
- value- The new value to assign as the delivery ID.
 
- 
resetpublic void reset()Clears the tracked value and marks this tracker as empty.
- 
isEmptypublic boolean isEmpty()- Returns:
- true if the tracker is not currently tracking a delivery Id.
 
- 
compareToCompares the tracked delivery id value to theNumbergiven, if no value is being tracked this method returns -1. 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 tracked id with.
- Returns:
- the result of comparing the tracked id to the provided number.
 
- 
compareTopublic int compareTo(int other) Compares the tracked delivery id value to theintgiven, if no value is being tracked this method returns -1. 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 primitive- Integerto compare the tracked id with.
- Returns:
- the result of comparing the tracked id to the provided primitive integer value.
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<DeliveryIdTracker>
 
- 
intValuepublic int intValue()
- 
longValuepublic long longValue()
- 
floatValuepublic float floatValue()- Specified by:
- floatValuein class- Number
 
- 
doubleValuepublic double doubleValue()- Specified by:
- doubleValuein class- Number
 
- 
equals
- 
equalspublic boolean equals(int other) Performs an unsigned comparison between the value being tracked and the integer value passed, if no id is currently being tracked then this method returns false.- Parameters:
- other- The value to compare to the currently tracked id.
- Returns:
- true if the tracked delivery id matches the integer value provided.
 
- 
hashCodepublic int hashCode()
- 
toUnsignedInteger- Returns:
- an UnsignedIntegerview of the tracked delivery id, or null if not tracking at this time.
 
- 
toString
 
-