Package org.egothor.stemmer.trie
Record Class NodeData<V>
java.lang.Object
java.lang.Record
org.egothor.stemmer.trie.NodeData<V>
- Type Parameters:
V- value type- Record Components:
edgeLabels- edge labelschildNodeIds- child node identifiersorderedValues- ordered valuesorderedCounts- ordered counts
public record NodeData<V>(char[] edgeLabels, int[] childNodeIds, V[] orderedValues, int[] orderedCounts)
extends Record
Intermediate node data used during deserialization before child references
are resolved.
The arrays exposed by the accessors are the internal backing storage of this holder. They are returned directly for efficiency because the deserialization pipeline copies references into immutable compiled nodes immediately after the record is created. Callers must therefore treat every returned array as read-only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the internal child-node identifier array.char[]Returns the internal edge-label array.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.int[]Returns the internal ordered-counts array.V[]Returns the internal ordered-values array.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NodeData
Creates one validated node-data holder.- Throws:
NullPointerException- if any array argument isnullIllegalArgumentException- if the edge-related arrays or value-related arrays do not have matching lengths
-
-
Method Details
-
edgeLabels
public char[] edgeLabels()Returns the internal edge-label array.The returned array is not copied for performance reasons and must be treated as read-only.
- Returns:
- internal edge-label array
-
childNodeIds
public int[] childNodeIds()Returns the internal child-node identifier array.The returned array is not copied for performance reasons and must be treated as read-only.
- Returns:
- internal child-node identifier array
-
orderedValues
Returns the internal ordered-values array.The returned array is not copied for performance reasons and must be treated as read-only.
- Returns:
- internal ordered-values array
-
orderedCounts
public int[] orderedCounts()Returns the internal ordered-counts array.The returned array is not copied for performance reasons and must be treated as read-only.
- Returns:
- internal ordered-counts array
-
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).
-