Class LogicalNode

java.lang.Object
org.eclipse.ditto.rql.model.predicates.ast.SuperNode
org.eclipse.ditto.rql.model.predicates.ast.LogicalNode
All Implemented Interfaces:
Node

public final class LogicalNode extends SuperNode
Implements logical nodes like AND or OR. A logical node has a name and several children to which the logic of this node has to be applied.
  • Constructor Details

    • LogicalNode

      public LogicalNode(String name)
      Constructor. Creates a new node with the given name.
      Parameters:
      name - name of this logical node.
    • LogicalNode

      public LogicalNode(LogicalNode.Type type)
      Constructor. Creates a new node with the given type.
      Parameters:
      type - type of this logical node.
    • LogicalNode

      public LogicalNode(LogicalNode.Type type, Node... subNodes)
      Constructor. Creates a new node with the given type.
      Parameters:
      type - type of this logical node.
      subNodes - the Nodes to add directly as children.
    • LogicalNode

      public LogicalNode(LogicalNode.Type type, Collection<Node> subNodes)
      Constructor. Creates a new node with the given type.
      Parameters:
      type - type of this logical node.
      subNodes - the Nodes to add directly as children.
  • Method Details

    • getName

      public String getName()
      Retrieve the name of this logical node.
      Returns:
      the name of the logical node.
    • getType

      public LogicalNode.Type getType()
      Retrieve the LogicalNode.Type of this logical node.
      Returns:
      the type of the logical node.
    • accept

      public void accept(PredicateVisitor predicateVisitor)
      Description copied from class: SuperNode
      PredicateVisitor Pattern. Takes a visitor as parameter and calls the corresponding visit method with itself as parameter.
      Specified by:
      accept in interface Node
      Overrides:
      accept in class SuperNode
      Parameters:
      predicateVisitor - the visitor which should be called.
    • toString

      public String toString()
      Overrides:
      toString in class SuperNode
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SuperNode
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class SuperNode