Record Class TerminalChunk
java.lang.Object
java.lang.Record
org.apache.juneau.terminal.region.TerminalChunk
- Record Components:
bytes- The bytes read, nevernull ; empty at the end of the stream.next- The offset to read from next.end- The source's current end offset.done- Whether the producer will write no more andnext == end.cols- The producer's terminal width.rows- The producer's terminal height.truncated- Whether the requested offset was no longer held, so the bytes start at the oldest offset held.gone- Whether the backing store disappeared; impliesdone. A gone chunk is empty, and itsnextandendare the requested offset.
public record TerminalChunk(byte[] bytes, long next, long end, boolean done, int cols, int rows, boolean truncated, boolean gone)
extends Record
One read from a
TerminalSource.
Offsets are absolute byte positions since the stream started; they never reset. bytes starts at
next - bytes.length, which is the requested offset unless truncated is set.
The record holds the bytes array itself, not a copy, and equality on it is by identity; treat it as read-only.
-
Constructor Summary
ConstructorsConstructorDescriptionTerminalChunk(byte[] bytes, long next, long end, boolean done, int cols, int rows, boolean truncated, boolean gone) Checks the members. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Returns the value of thebytesrecord component.intcols()Returns the value of thecolsrecord component.booleandone()Returns the value of thedonerecord component.longend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.booleangone()Returns the value of thegonerecord component.final inthashCode()Returns a hash code value for this object.longnext()Returns the value of thenextrecord component.introws()Returns the value of therowsrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetruncatedrecord component.
-
Constructor Details
-
TerminalChunk
public TerminalChunk(byte[] bytes, long next, long end, boolean done, int cols, int rows, boolean truncated, boolean gone) Checks the members.- Throws:
IllegalArgumentException- If a member is out of range.
-
-
Method Details
-
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
bytes
Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-
next
Returns the value of thenextrecord component.- Returns:
- the value of the
nextrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
done
Returns the value of thedonerecord component.- Returns:
- the value of the
donerecord component
-
cols
Returns the value of thecolsrecord component.- Returns:
- the value of the
colsrecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-
truncated
Returns the value of thetruncatedrecord component.- Returns:
- the value of the
truncatedrecord component
-
gone
Returns the value of thegonerecord component.- Returns:
- the value of the
gonerecord component
-