Record Class TreeBuilder.Step
java.lang.Object
java.lang.Record
org.libxmq.imp.ixml.earley.TreeBuilder.Step
- Record Components:
step- the nodes are numbered 1, 2, ... in the order they are addedparent- the step of the parent node, 0 for the rootproduction- the productionfrom- the input position where the node startsto- the input position after the nodecost- the cost of the node with its childrenchosen- true if the node is in the final treetree_parent- the step of the parent in the final tree, 0 for the root or if not chosen. A node is composed once, for its first parent, and can be used by another.
- Enclosing class:
TreeBuilder
public static record TreeBuilder.Step(int step, int parent, Grammar.Production production, int from, int to, int cost, boolean chosen, int tree_parent)
extends Record
A node added to the tree: a production over a span of the input.
-
Constructor Summary
ConstructorsConstructorDescriptionStep(int step, int parent, Grammar.Production production, int from, int to, int cost, boolean chosen, int tree_parent) Creates an instance of aSteprecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanchosen()Returns the value of thechosenrecord component.intcost()Returns the value of thecostrecord component.final booleanIndicates whether some other object is "equal to" this one.intfrom()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.intparent()Returns the value of theparentrecord component.Returns the value of theproductionrecord component.intstep()Returns the value of thesteprecord component.intto()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetree_parentrecord component.
-
Constructor Details
-
Step
public Step(int step, int parent, Grammar.Production production, int from, int to, int cost, boolean chosen, int tree_parent) Creates an instance of aSteprecord class.- Parameters:
step- the value for thesteprecord componentparent- the value for theparentrecord componentproduction- the value for theproductionrecord componentfrom- the value for thefromrecord componentto- the value for thetorecord componentcost- the value for thecostrecord componentchosen- the value for thechosenrecord componenttree_parent- the value for thetree_parentrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
step
-
parent
-
production
Returns the value of theproductionrecord component.- Returns:
- the value of the
productionrecord component
-
from
-
to
-
cost
-
chosen
-
tree_parent
public int tree_parent()Returns the value of thetree_parentrecord component.- Returns:
- the value of the
tree_parentrecord component
-