APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http.quic.frames

public final Class AckFrame

extends QuicFrame
Class Inheritance
Imports
jdk.internal.net.http.quic.packets.QuicPacket, jdk.internal.net.quic.QuicTransportErrors, .QuicTransportException, java.nio.BufferOverflowException, .ByteBuffer, java.util.ArrayList, .Iterator, .List, .ListIterator, .Objects, .Spliterator, java.util.function.LongConsumer, java.util.stream.LongStream, .StreamSupport

An ACK Frame
External Specification
https://www.rfc-editor.org/info/rfc9000

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AckFrame.AckFrameBuilder

A builder that allows to incrementally build the AckFrame that will need to be sent, as new packets are received.

private static class
public static record
AckFrame.AckRange

An ACK range, composed of a gap and a range.

Field Summary

Modifier and TypeField and Description
private final long
private final int
private final List<AckFrame.AckRange>
private static final int
private final boolean
private final long
private final long
private final long
private final long
private final int
Inherited from jdk.internal.net.http.quic.frames.QuicFrame:
ACKCONNECTION_CLOSECRYPTODATA_BLOCKEDHANDSHAKE_DONEMAX_DATAMAX_STREAM_DATAMAX_STREAMSMAX_VL_INTEGERNEW_CONNECTION_IDNEW_TOKENPADDINGPATH_CHALLENGEPATH_RESPONSEPINGRESET_STREAMRETIRE_CONNECTION_IDSTOP_SENDINGSTREAMSTREAM_DATA_BLOCKEDSTREAMS_BLOCKED

Constructor Summary

AccessConstructor and Description
pack-priv
AckFrame(ByteBuffer
a buffer containing the ACK frame
buffer
,
int
the frame type read from the buffer
type
)

Reads an AckFrame from the given buffer.

public
AckFrame(long largestAcknowledged, long ackDelay, List<AckFrame.AckRange> ackRanges)

Creates the short formed ACK frame with no count totals

public
AckFrame(long largestAcknowledged, long ackDelay, List<AckFrame.AckRange> ackRanges, long ect0Count, long ect1Count, long ecnCECount)

Creates the long formed ACK frame with count totals

Method Summary

Modifier and TypeMethod and Description
public long
ackDelay()

The ACK delay

public LongStream
acknowledged()

Returns: a stream of packet numbers acknowledged by this frame

public long

Returns:

the number of ack ranges
ackRangeCount
()

Returns the number of ack ranges.

public List<AckFrame.AckRange>

Returns:

the list of AckRange where the first ack range has a gap of 0 and a range corresponding to the First ACK Range.
ackRanges
()

The ack ranges.

private int
public long

Returns:

the ECN-CE count from this frame or -1 if not present
ecnCECount
()

Returns the ECN-CE count from this frame or -1 if not present.

public long

Returns:

the ECT0 count from this frame or -1 if not present
ect0Count
()

Returns the ECT0 count from this frame or -1 if not present.

public long

Returns:

the ECT1 count from this frame or -1 if not present
ect1Count
()

Returns the ECT1 count from this frame or -1 if not present.

public void
encode(ByteBuffer buffer)

Implements abstract jdk.internal.net.http.quic.frames.QuicFrame.encode.

Encode this QUIC Frame into given ByteBuffer

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public long
getTypeField()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.getTypeField.

Returns the type field that was / should be encoded.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isAckEliciting()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.isAckEliciting.

Returns true if this frame is ACK-eliciting.

public boolean

Returns:

true if this frame contains an acknowledgment for the given packet number
isAcknowledging
(long
a packet number
packetNumber
)

Returns true if this frame contains an acknowledgment for the given packet number.

private static boolean
isAcknowledging(long largestAcknowledged, List<AckFrame.AckRange> ackRanges, long packetNumber)

public boolean

Returns:

true if the given range is acknowledged by this frame
isRangeAcknowledged
(long
the first packet in the range, inclusive
first
,
long
the last packet in the range, inclusive
last
)

Returns true if the given range is acknowledged by this frame.

private static boolean
isRangeAcknowledged(long largestAcknowledged, List<AckFrame.AckRange> ackRanges, long first, long last)

public long

Returns:

largest packet number acknowledged by this frame
largestAcknowledged
()

Returns largest packet number acknowledged by this frame.

public static long

Returns:

the largest packet acknowledged by an ACK frame contained in the given packet, or -1L if the packet contains no ACK frame
largestAcknowledgedInPacket
(QuicPacket
a packet that may contain an ACK frame
packet
)

Returns the largest packet acknowledged by an ACK frame contained in the given packet, or -1L if the packet contains no ACK frame.

private String
public int
size()

Implements abstract jdk.internal.net.http.quic.frames.QuicFrame.size.

Returns the minimum number of bytes needed to encode this frame.

public long

Returns:

the smallest packet number acknowledged by this AckFrame
smallestAcknowledged
()

Returns the smallest packet number acknowledged by this AckFrame.

private static long
smallestAcknowledged(long largestAcknowledged, List<AckFrame.AckRange> ackRanges)

public String
toString()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.toString.

Returns a string representation of the object.

public AckFrame

Returns:

a new AckFrame identical to this one, but with the given ackDelay
withAckDelay
(long
the delay sending the Ack Frame
ackDelay
)

Returns a new AckFrame identical to this one, but with the given ackDelay.

Inherited from jdk.internal.net.http.quic.frames.QuicFrame:
decodedecodeVLFielddecodeVLFieldAsIntencodeVLFieldframeClassOfframeTypeframeTypeOfgetVLFieldLengthForisValidInputByteBufferrequireVLRangerequireVLRangevalidateRemainingLength

Field Detail

ackDelayback to summary
private final long ackDelay
ackRangeCountback to summary
private final int ackRangeCount
ackRangesback to summary
private final List<AckFrame.AckRange> ackRanges
COUNTS_PRESENTback to summary
private static final int COUNTS_PRESENT
countsPresentback to summary
private final boolean countsPresent
ecnCECountback to summary
private final long ecnCECount
ect0Countback to summary
private final long ect0Count
ect1Countback to summary
private final long ect1Count
largestAcknowledgedback to summary
private final long largestAcknowledged
sizeback to summary
private final int size

Constructor Detail

AckFrameback to summary
pack-priv AckFrame(ByteBuffer buffer, int type) throws QuicTransportException

Reads an AckFrame from the given buffer. When entering this method the buffer position is supposed to be just past after the frame type. That, is the frame type has already been read. This method moves the position of the buffer to the first byte after the read ACK frame.

Parameters
buffer:ByteBuffer

a buffer containing the ACK frame

type:int

the frame type read from the buffer

Exceptions
QuicTransportException:
if the ACK frame was malformed
AckFrameback to summary
public AckFrame(long largestAcknowledged, long ackDelay, List<AckFrame.AckRange> ackRanges)

Creates the short formed ACK frame with no count totals

AckFrameback to summary
public AckFrame(long largestAcknowledged, long ackDelay, List<AckFrame.AckRange> ackRanges, long ect0Count, long ect1Count, long ecnCECount)

Creates the long formed ACK frame with count totals

Method Detail

ackDelayback to summary
public long ackDelay()

The ACK delay

acknowledgedback to summary
public LongStream acknowledged()
Returns:LongStream

a stream of packet numbers acknowledged by this frame

ackRangeCountback to summary
public long ackRangeCount()

Returns the number of ack ranges. This corresponds to ackRange.size() -1.

Returns:long

the number of ack ranges

ackRangesback to summary
public List<AckFrame.AckRange> ackRanges()

The ack ranges. First element is an actual range relative to highest acknowledged packet number. Second (if present) is a gap and a range following that gap, and so on until the last.

Returns:List<AckFrame.AckRange>

the list of AckRange where the first ack range has a gap of 0 and a range corresponding to the First ACK Range.

computeSizeback to summary
private int computeSize()
ecnCECountback to summary
public long ecnCECount()

Returns the ECN-CE count from this frame or -1 if not present.

Returns:long

the ECN-CE count from this frame or -1 if not present

ect0Countback to summary
public long ect0Count()

Returns the ECT0 count from this frame or -1 if not present.

Returns:long

the ECT0 count from this frame or -1 if not present

ect1Countback to summary
public long ect1Count()

Returns the ECT1 count from this frame or -1 if not present.

Returns:long

the ECT1 count from this frame or -1 if not present

encodeback to summary
public void encode(ByteBuffer buffer)

Implements abstract jdk.internal.net.http.quic.frames.QuicFrame.encode.

Doc from jdk.internal.net.http.quic.frames.QuicFrame.encode.

Encode this QUIC Frame into given ByteBuffer

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getTypeFieldback to summary
public long getTypeField()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.getTypeField.

Doc from jdk.internal.net.http.quic.frames.QuicFrame.getTypeField.

Returns the type field that was / should be encoded. This is the frame type with possibly some additional bits set, depending on the frame.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isAckElicitingback to summary
public boolean isAckEliciting()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.isAckEliciting.

Doc from jdk.internal.net.http.quic.frames.QuicFrame.isAckEliciting.

Returns true if this frame is ACK-eliciting. A frame is ACK-eliciting if it is anything other than QuicFrame#ACK, QuicFrame#PADDING or QuicFrame#CONNECTION_CLOSE (or its variant).

Annotations
@Override
isAcknowledgingback to summary
public boolean isAcknowledging(long packetNumber)

Returns true if this frame contains an acknowledgment for the given packet number.

Parameters
packetNumber:long

a packet number

Returns:boolean

true if this frame contains an acknowledgment for the given packet number

isAcknowledgingback to summary
private static boolean isAcknowledging(long largestAcknowledged, List<AckFrame.AckRange> ackRanges, long packetNumber)
isRangeAcknowledgedback to summary
public boolean isRangeAcknowledged(long first, long last)

Returns true if the given range is acknowledged by this frame.

Parameters
first:long

the first packet in the range, inclusive

last:long

the last packet in the range, inclusive

Returns:boolean

true if the given range is acknowledged by this frame

isRangeAcknowledgedback to summary
private static boolean isRangeAcknowledged(long largestAcknowledged, List<AckFrame.AckRange> ackRanges, long first, long last)
largestAcknowledgedback to summary
public long largestAcknowledged()

Returns largest packet number acknowledged by this frame.

Returns:long

largest packet number acknowledged by this frame

largestAcknowledgedInPacketback to summary
public static long largestAcknowledgedInPacket(QuicPacket packet)

Returns the largest packet acknowledged by an ACK frame contained in the given packet, or -1L if the packet contains no ACK frame.

Parameters
packet:QuicPacket

a packet that may contain an ACK frame

Returns:long

the largest packet acknowledged by an ACK frame contained in the given packet, or -1L if the packet contains no ACK frame

prettyRangesback to summary
private String prettyRanges()
sizeback to summary
public int size()

Implements abstract jdk.internal.net.http.quic.frames.QuicFrame.size.

Doc from jdk.internal.net.http.quic.frames.QuicFrame.size.

Returns the minimum number of bytes needed to encode this frame.

Annotations
@Override
smallestAcknowledgedback to summary
public long smallestAcknowledged()

Returns the smallest packet number acknowledged by this AckFrame.

Returns:long

the smallest packet number acknowledged by this AckFrame

smallestAcknowledgedback to summary
private static long smallestAcknowledged(long largestAcknowledged, List<AckFrame.AckRange> ackRanges)
toStringback to summary
public String toString()

Overrides jdk.internal.net.http.quic.frames.QuicFrame.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
withAckDelayback to summary
public AckFrame withAckDelay(long ackDelay)

Returns a new AckFrame identical to this one, but with the given ackDelay. ;

Parameters
ackDelay:long

the delay sending the Ack Frame

Returns:AckFrame

a new AckFrame identical to this one, but with the given ackDelay

jdk.internal.net.http.quic.frames back to summary

public final Class AckFrame.AckFrameBuilder

extends Object
Class Inheritance

A builder that allows to incrementally build the AckFrame that will need to be sent, as new packets are received. This class is not MT-thread safe.

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv List<AckFrame.AckRange>
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long

Constructor Summary

AccessConstructor and Description
public
AckFrameBuilder()

An empty builder.

public
AckFrameBuilder(AckFrame
the AckFrame to initialize this builder with. Must not be null.
frame
)

A builder initialize from the content of an AckFrame.

Method Summary

Modifier and TypeMethod and Description
public AckFrame.AckFrameBuilder

Returns:

this builder.
ackDelay
(long
the ack delay.
ackDelay
)

Sets the ack delay.

private AckFrame.AckFrameBuilder
acknowledgeFirstPacket(long packetNumber)

private AckFrame.AckFrameBuilder
acknowledgeLargerPacket(long largerThanLargest)

public AckFrame.AckFrameBuilder

Returns:

this builder
addAck
(long
the packet number
packetNumber
)

Adds the given packet number to the list of ack ranges.

public AckFrame

Returns:

a new AckFrame.
build
()

Builds an AckFrame from this builder's content.

public AckFrame.AckFrameBuilder

Returns:

this builder
dropAckRangesAfter
(int
the index after which ranges should be dropped.
index
)

Drops all instances of AckRange after the given index in the Ack Range List, and compute the new smallest packet number now acknowledged by this AckFrame: this computed packet number will then be returned by getLargestAckAcked().

public AckFrame.AckFrameBuilder

Returns:

this builder
dropAcksBefore
(long
the smallest packet number that should be acknowledged by this AckFrame.
largestAckAcked
)

Drops all acks for packet whose number is smaller than the given largestAckAcked.

private AckFrame.AckFrameBuilder
dropIfSmallerThan(long largestAckAcked)

private long
dropRangesIfAfter(int ackIndex)

public AckFrame.AckFrameBuilder

Returns:

this builder.
ecnCECount
(long
the ecnCECount
ecnCECount
)

Sets the ecnCECount.

public AckFrame.AckFrameBuilder

Returns:

this builder.
ect0Count
(long
the ect0Count
ect0Count
)

Sets the ect0Count.

public AckFrame.AckFrameBuilder

Returns:

this builder.
ect1Count
(long
the ect1Count
ect1Count
)

Sets the ect1Count.

public long
public boolean

Returns:

true if the given packet number is already acknowledged by this builder
isAcknowledging
(long
a packet number
packetNumber
)

Returns true if the given packet number is already acknowledged by this builder.

public boolean

Returns:

true if this builder contains no ACK yet
isEmpty
()

Returns true if this builder contains no ACK yet.

public int

Returns:

the number of ACK ranges in this builder, including the fake first ACK range
length
()

Returns the number of ACK ranges in this builder, including the fake first ACK range.

public static AckFrame.AckFrameBuilder
public long

Returns:

the smallest packet number acknowledged by this AckFrame
smallestAcknowledged
()

Returns the smallest packet number acknowledged by this AckFrame.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ackDelayback to summary
pack-priv long ackDelay
ackRangesback to summary
pack-priv List<AckFrame.AckRange> ackRanges
ecnCECountback to summary
pack-priv long ecnCECount
ect0Countback to summary
pack-priv long ect0Count
ect1Countback to summary
pack-priv long ect1Count
largestAckAckedback to summary
pack-priv long largestAckAcked
largestAcknowledgedback to summary
pack-priv long largestAcknowledged

Constructor Detail

AckFrameBuilderback to summary
public AckFrameBuilder()

An empty builder.

AckFrameBuilderback to summary
public AckFrameBuilder(AckFrame frame)

A builder initialize from the content of an AckFrame.

Parameters
frame:AckFrame

the AckFrame to initialize this builder with. Must not be null.

Method Detail

ackDelayback to summary
public AckFrame.AckFrameBuilder ackDelay(long ackDelay)

Sets the ack delay.

Parameters
ackDelay:long

the ack delay.

Returns:AckFrame.AckFrameBuilder

this builder.

acknowledgeFirstPacketback to summary
private AckFrame.AckFrameBuilder acknowledgeFirstPacket(long packetNumber)
acknowledgeLargerPacketback to summary
private AckFrame.AckFrameBuilder acknowledgeLargerPacket(long largerThanLargest)
addAckback to summary
public AckFrame.AckFrameBuilder addAck(long packetNumber)

Adds the given packet number to the list of ack ranges. If the packet is already being acknowledged by this frame, do nothing.

Parameters
packetNumber:long

the packet number

Returns:AckFrame.AckFrameBuilder

this builder

buildback to summary
public AckFrame build()

Builds an AckFrame from this builder's content.

Returns:AckFrame

a new AckFrame.

dropAckRangesAfterback to summary
public AckFrame.AckFrameBuilder dropAckRangesAfter(int index)

Drops all instances of AckRange after the given index in the Ack Range List, and compute the new smallest packet number now acknowledged by this AckFrame: this computed packet number will then be returned by getLargestAckAcked(). This is a no-op if index is greater or equal to ackRanges().size() -1.

Parameters
index:int

the index after which ranges should be dropped.

Returns:AckFrame.AckFrameBuilder

this builder

dropAcksBeforeback to summary
public AckFrame.AckFrameBuilder dropAcksBefore(long largestAckAcked)

Drops all acks for packet whose number is smaller than the given largestAckAcked.

Parameters
largestAckAcked:long

the smallest packet number that should be acknowledged by this AckFrame.

Returns:AckFrame.AckFrameBuilder

this builder

dropIfSmallerThanback to summary
private AckFrame.AckFrameBuilder dropIfSmallerThan(long largestAckAcked)
dropRangesIfAfterback to summary
private long dropRangesIfAfter(int ackIndex)
ecnCECountback to summary
public AckFrame.AckFrameBuilder ecnCECount(long ecnCECount)

Sets the ecnCECount. Passing -1 unsets the ecnCEOcount.

Parameters
ecnCECount:long

the ecnCECount

Returns:AckFrame.AckFrameBuilder

this builder.

ect0Countback to summary
public AckFrame.AckFrameBuilder ect0Count(long ect0Count)

Sets the ect0Count. Passing -1 unsets the ectOcount.

Parameters
ect0Count:long

the ect0Count

Returns:AckFrame.AckFrameBuilder

this builder.

ect1Countback to summary
public AckFrame.AckFrameBuilder ect1Count(long ect1Count)

Sets the ect1Count. Passing -1 unsets the ect1count.

Parameters
ect1Count:long

the ect1Count

Returns:AckFrame.AckFrameBuilder

this builder.

getLargestAckAckedback to summary
public long getLargestAckAcked()
isAcknowledgingback to summary
public boolean isAcknowledging(long packetNumber)

Returns true if the given packet number is already acknowledged by this builder.

Parameters
packetNumber:long

a packet number

Returns:boolean

true if the given packet number is already acknowledged by this builder

isEmptyback to summary
public boolean isEmpty()

Returns true if this builder contains no ACK yet.

Returns:boolean

true if this builder contains no ACK yet

lengthback to summary
public int length()

Returns the number of ACK ranges in this builder, including the fake first ACK range.

Returns:int

the number of ACK ranges in this builder, including the fake first ACK range

ofNullableback to summary
public static AckFrame.AckFrameBuilder ofNullable(AckFrame frame)
smallestAcknowledgedback to summary
public long smallestAcknowledged()

Returns the smallest packet number acknowledged by this AckFrame.

Returns:long

the smallest packet number acknowledged by this AckFrame

jdk.internal.net.http.quic.frames back to summary

private Class AckFrame.AckFrameSpliterator

extends Object
implements OfLong
Class Inheritance
  • java.lang.Object
  • jdk.internal.net.http.quic.frames.AckFrame.AckFrameSpliterator
All Implemented Interfaces
java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive, java.util.Spliterator

Field Summary

Modifier and TypeField and Description
pack-priv final AckFrame
private final Iterator<AckFrame.AckRange>
private long
private long
private long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
public int
characteristics()

Implements java.util.Spliterator.characteristics.

Returns a set of characteristics of this Spliterator and its elements.

public long
estimateSize()

Implements java.util.Spliterator.estimateSize.

Returns an estimate of the number of elements that would be encountered by a forEachRemaining traversal, or returns Long#MAX_VALUE if infinite, unknown, or too expensive to compute.

public boolean
tryAdvance(LongConsumer action)

Implements java.util.Spliterator.OfLong.tryAdvance.

If a remaining element exists, performs the given action on it, returning true; else returns false.

public Spliterator.OfLong
trySplit()

Implements java.util.Spliterator.OfLong.trySplit.

If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ackFrameback to summary
pack-priv final AckFrame ackFrame
ackRangeIteratorback to summary
private final Iterator<AckFrame.AckRange> ackRangeIterator
largestback to summary
private long largest
pnback to summary
private long pn
smallestback to summary
private long smallest

Constructor Detail

AckFrameSpliteratorback to summary
pack-priv AckFrameSpliterator(AckFrame ackFrame)

Method Detail

ackAndDecIdback to summary
private boolean ackAndDecId(LongConsumer action)
characteristicsback to summary
public int characteristics()

Implements java.util.Spliterator.characteristics.

Doc from java.util.Spliterator.characteristics.

Returns a set of characteristics of this Spliterator and its elements. The result is represented as ORed values from ORDERED, DISTINCT, SORTED, SIZED, NONNULL, IMMUTABLE, CONCURRENT, SUBSIZED. Repeated calls to characteristics() on a given spliterator, prior to or in-between calls to trySplit, should always return the same result.

If a Spliterator reports an inconsistent set of characteristics (either those returned from a single invocation or across multiple invocations), no guarantees can be made about any computation using this Spliterator.

Annotations
@Override
estimateSizeback to summary
public long estimateSize()

Implements java.util.Spliterator.estimateSize.

Doc from java.util.Spliterator.estimateSize.

Returns an estimate of the number of elements that would be encountered by a forEachRemaining traversal, or returns Long#MAX_VALUE if infinite, unknown, or too expensive to compute.

If this Spliterator is SIZED and has not yet been partially traversed or split, or this Spliterator is SUBSIZED and has not yet been partially traversed, this estimate must be an accurate count of elements that would be encountered by a complete traversal. Otherwise, this estimate may be arbitrarily inaccurate, but must decrease as specified across invocations of trySplit.

Annotations
@Override
tryAdvanceback to summary
public boolean tryAdvance(LongConsumer action)

Implements java.util.Spliterator.OfLong.tryAdvance.

Doc from java.util.Spliterator.OfPrimitive.tryAdvance.

If a remaining element exists, performs the given action on it, returning true; else returns false. If this Spliterator is ORDERED the action is performed on the next element in encounter order. Exceptions thrown by the action are relayed to the caller.

Subsequent behavior of a spliterator is unspecified if the action throws an exception.

Annotations
@Override
trySplitback to summary
public Spliterator.OfLong trySplit()

Implements java.util.Spliterator.OfLong.trySplit.

Doc from java.util.Spliterator.trySplit.

If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.

If this Spliterator is ORDERED, the returned Spliterator must cover a strict prefix of the elements.

Unless this Spliterator covers an infinite number of elements, repeated calls to trySplit() must eventually return null. Upon non-null return:

  • the value reported for estimateSize() before splitting, must, after splitting, be greater than or equal to estimateSize() for this and the returned Spliterator; and
  • if this Spliterator is SUBSIZED, then estimateSize() for this spliterator before splitting must be equal to the sum of estimateSize() for this and the returned Spliterator after splitting.

This method may return null for any reason, including emptiness, inability to split after traversal has commenced, data structure constraints, and efficiency considerations.

Annotations
@Override
jdk.internal.net.http.quic.frames back to summary

public final Record AckFrame.AckRange

extends Record
Class Inheritance
Record Components
gap:long 
range:long 

An ACK range, composed of a gap and a range.

Field Summary

Modifier and TypeField and Description
private final long
gap

Record Component accessed by gap().

public static final AckFrame.AckRange
private final long
range

Record Component accessed by range().

Constructor Summary

AccessConstructor and Description
public
AckRange(long gap, long range)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public long
gap()

Record Component getter of gap.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public static AckFrame.AckRange
of(long gap, long range)

public long
range()

Record Component getter of range.

public int
size()

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

gapback to summary
private final long gap

Record Component accessed by gap().

INITIALback to summary
public static final AckFrame.AckRange INITIAL
rangeback to summary
private final long range

Record Component accessed by range().

Constructor Detail

AckRangeback to summary
public AckRange(long gap, long range)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
gapback to summary
public long gap()

Record Component getter of gap.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

ofback to summary
public static AckFrame.AckRange of(long gap, long range)
rangeback to summary
public long range()

Record Component getter of range.

sizeback to summary
public int size()
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.