Package io.github.mahmoudimus.quic.frame
Record Class Frame.AckRange
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.frame.Frame.AckRange
- Record Components:
smallest- the smallest packet number in the rangelargest- the largest packet number in the range
- Enclosing interface:
Frame
An inclusive range of acknowledged packet numbers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(long packetNumber) Whether a packet number lies in the range.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longlargest()Returns the value of thelargestrecord component.longsmallest()Returns the value of thesmallestrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AckRange
public AckRange(long smallest, long largest) A range.- Parameters:
smallest- the smallest packet numberlargest- the largest packet number, at leastsmallest
-
-
Method Details
-
contains
public boolean contains(long packetNumber) Whether a packet number lies in the range.- Parameters:
packetNumber- the packet number- Returns:
- true if
smallest <= packetNumber <= largest
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
smallest
public long smallest()Returns the value of thesmallestrecord component.- Returns:
- the value of the
smallestrecord component
-
largest
public long largest()Returns the value of thelargestrecord component.- Returns:
- the value of the
largestrecord component
-