Record Class ExpressionNode.Operator

java.lang.Object
java.lang.Record
org.cyclops.integrateddynamics.api.evaluate.expression.tree.ExpressionNode.Operator
Record Components:
operator - The operator.
children - The children, one for each operator input.
All Implemented Interfaces:
ExpressionNode
Enclosing interface:
ExpressionNode

public static record ExpressionNode.Operator(IOperator operator, List<ExpressionNode> children) extends Record implements ExpressionNode
An operator applied to child nodes.
  • Constructor Details

    • Operator

      public Operator(IOperator operator, List<ExpressionNode> children)
      Creates an instance of a Operator record class.
      Parameters:
      operator - the value for the operator record component
      children - the value for the children record component
  • Method Details

    • ofEmpty

      public static ExpressionNode.Operator ofEmpty(IOperator operator)
      Parameters:
      operator - An operator.
      Returns:
      A node for the given operator with all children empty.
    • withChild

      public ExpressionNode.Operator withChild(int index, ExpressionNode child)
      Parameters:
      index - A child index.
      child - The new child.
      Returns:
      A copy of this node with the given child replaced.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • operator

      public IOperator operator()
      Returns the value of the operator record component.
      Returns:
      the value of the operator record component
    • children

      public List<ExpressionNode> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component