Class NAryQueryNode<T extends QueryNode>

    • Constructor Detail

      • NAryQueryNode

        public NAryQueryNode​(QueryNode parent)
        Creates a new NAryQueryNode with a reference to a parent QueryNode.
        Parameters:
        parent - the parent node.
      • NAryQueryNode

        public NAryQueryNode​(QueryNode parent,
                             T[] operands)
        Creates a new NAryQueryNode with a reference to a parent QueryNode and initial operands.
        Parameters:
        parent - the parent node.
        operands - child nodes of this NAryQueryNode.
    • Method Detail

      • addOperand

        public void addOperand​(T operand)
        Adds a new operand (child node) to this query node.
        Parameters:
        operand - the child QueryNode to add.
      • removeOperand

        public boolean removeOperand​(T operand)
        Removes an operand (child node) from this query node.
        Parameters:
        operand - the child to remove.
        Returns:
        true if the operand was in the list of child nodes and has been removed; false if this node does not contain operand as a child node.
      • getOperands

        public QueryNode[] getOperands()
        Returns an array of currently set QueryNode operands of this QueryNode. Returns an empty array if no operands are set.
        Returns:
        currently set QueryNode operands.
      • getNumOperands

        public int getNumOperands()
        Returns the number of operands.
        Returns:
        the number of operands.
      • acceptOperands

        public java.lang.Object[] acceptOperands​(QueryNodeVisitor visitor,
                                                 java.lang.Object data)
                                          throws RepositoryException
        Helper class to accept a visitor for all operands of this NAryQueryNode.
        Parameters:
        visitor - the visitor to call back.
        data - arbitrary data for the visitor.
        Returns:
        the return values of the visitor.visit() calls.
        Throws:
        RepositoryException - if an error occurs.
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns true if obj is the same type of QueryNode as this node and is equal to this node.
        Specified by:
        equals in class QueryNode
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if obj is equal to this; false otherwise.
      • needsSystemTree

        public boolean needsSystemTree()
        Returns true if this query node needs items under /jcr:system to be queried.
        Specified by:
        needsSystemTree in class QueryNode
        Returns:
        true if this query node needs content under /jcr:system to be queried; false otherwise.