Package dev.roanh.cpqindex
Record Class BlockPair
java.lang.Object
java.lang.Record
dev.roanh.cpqindex.BlockPair
- Record Components:
first
- The first block.second
- The second block.
Simple record representing a pair of blocks.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Index.Block
The field for thefirst
record component.private final Index.Block
The field for thesecond
record component. -
Constructor Summary
ConstructorDescriptionBlockPair
(Index.Block first, Index.Block second) Creates an instance of aBlockPair
record class.Constructs a new block pair from the given path pair.BlockPair
(DataInputStream in, dev.roanh.gmark.util.RangeList<Index.Block> blockMap) Reads a previously saved block pair from the given stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.first()
Returns the value of thefirst
record component.final int
hashCode()
Returns a hash code value for this object.second()
Returns the value of thesecond
record component.final String
toString()
Returns a string representation of this record class.void
write
(DataOutputStream out) Writes this block pair to the given stream.
-
Field Details
-
Constructor Details
-
BlockPair
Constructs a new block pair from the given path pair.- Parameters:
pair
- The path pair to get the blocks from.
-
BlockPair
public BlockPair(DataInputStream in, dev.roanh.gmark.util.RangeList<Index.Block> blockMap) throws IOException Reads a previously saved block pair from the given stream.- Parameters:
in
- The stream to read from.blockMap
- A map of blocks read so far by ID.- Throws:
IOException
- When an IOException occurs.
-
BlockPair
Creates an instance of aBlockPair
record class.
-
-
Method Details
-
write
Writes this block pair to the given stream.- Parameters:
out
- The stream to write to.- Throws:
IOException
- When an IOException occurs.
-
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 withObjects::equals(Object,Object)
. -
first
Returns the value of thefirst
record component.- Returns:
- the value of the
first
record component
-
second
Returns the value of thesecond
record component.- Returns:
- the value of the
second
record component
-