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 added
parent - the step of the parent node, 0 for the root
production - the production
from - the input position where the node starts
to - the input position after the node
cost - the cost of the node with its children
chosen - true if the node is in the final tree
tree_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

    Constructors
    Constructor
    Description
    Step(int step, int parent, Grammar.Production production, int from, int to, int cost, boolean chosen, int tree_parent)
    Creates an instance of a Step record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the chosen record component.
    int
    Returns the value of the cost record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the from record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the parent record component.
    Returns the value of the production record component.
    int
    Returns the value of the step record component.
    int
    to()
    Returns the value of the to record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the tree_parent record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a Step record class.
      Parameters:
      step - the value for the step record component
      parent - the value for the parent record component
      production - the value for the production record component
      from - the value for the from record component
      to - the value for the to record component
      cost - the value for the cost record component
      chosen - the value for the chosen record component
      tree_parent - the value for the tree_parent record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • step

      public int step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • parent

      public int parent()
      Returns the value of the parent record component.
      Returns:
      the value of the parent record component
    • production

      public Grammar.Production production()
      Returns the value of the production record component.
      Returns:
      the value of the production record component
    • from

      public int from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public int to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • cost

      public int cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component
    • chosen

      public boolean chosen()
      Returns the value of the chosen record component.
      Returns:
      the value of the chosen record component
    • tree_parent

      public int tree_parent()
      Returns the value of the tree_parent record component.
      Returns:
      the value of the tree_parent record component