Record Class CompiledNode<V>
- Type Parameters:
V- value type- Record Components:
edgeLabels- internal edge label arraychildren- internal child arrayorderedValues- internal ordered values arrayorderedCounts- internal ordered counts array
The returned arrays are the internal backing storage of the compiled node. They are exposed for efficient access by closely related trie infrastructure and therefore must never be modified by callers. The node itself is still immutable from the public API perspective because construction wires these arrays once and all lookup operations thereafter treat them as read-only.
-
Constructor Summary
ConstructorsConstructorDescriptionCompiledNode(char[] edgeLabels, CompiledNode<V>[] children, V[] orderedValues, int... orderedCounts) Creates one validated compiled node. -
Method Summary
Modifier and TypeMethodDescriptionCompiledNode<V>[]children()Returns the internal child-node array.char[]Returns the internal edge-label array.final booleanIndicates whether some other object is "equal to" this one.findChild(char edge) Finds a child for the supplied edge character.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
-
CompiledNode
public CompiledNode(char[] edgeLabels, CompiledNode<V>[] children, V[] orderedValues, int... orderedCounts) Creates one validated compiled node.- 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
-
children
Returns the internal child-node array.The returned array is not copied for performance reasons and must be treated as read-only by external callers.
- Returns:
- internal child-node 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
-
findChild
Finds a child for the supplied edge character.- Parameters:
edge- edge character- Returns:
- child node, or
nullif absent
-
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).
-