public abstract class NAryQueryNode<T extends QueryNode> extends QueryNode
TYPE_AND, TYPE_DEREF, TYPE_EXACT, TYPE_LOCATION, TYPE_NODETYPE, TYPE_NOT, TYPE_OR, TYPE_ORDER, TYPE_PATH, TYPE_PROP_FUNCTION, TYPE_RELATION, TYPE_ROOT, TYPE_TEXTSEARCH
Constructor and Description |
---|
NAryQueryNode(QueryNode parent)
Creates a new
NAryQueryNode with a reference to a parent
QueryNode . |
NAryQueryNode(QueryNode parent,
T[] operands)
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
acceptOperands(QueryNodeVisitor visitor,
java.lang.Object data)
Helper class to accept a
visitor for all operands
of this NAryQueryNode . |
void |
addOperand(T operand)
Adds a new
operand (child node) to this query node. |
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. |
int |
getNumOperands()
Returns the number of operands.
|
QueryNode[] |
getOperands()
Returns an array of currently set
QueryNode operands of this
QueryNode . |
boolean |
needsSystemTree()
Returns
true if this query node needs items under
/jcr:system to be queried. |
boolean |
removeOperand(T operand)
Removes an
operand (child node) from this query node. |
public NAryQueryNode(QueryNode parent)
NAryQueryNode
with a reference to a parent
QueryNode
.parent
- the parent node.public void addOperand(T operand)
operand
(child node) to this query node.operand
- the child QueryNode
to add.public boolean removeOperand(T operand)
operand
(child node) from this query node.operand
- the child to remove.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.public QueryNode[] getOperands()
QueryNode
operands of this
QueryNode
. Returns an empty array if no operands are set.QueryNode
operands.public int getNumOperands()
public java.lang.Object[] acceptOperands(QueryNodeVisitor visitor, java.lang.Object data) throws RepositoryException
visitor
for all operands
of this NAryQueryNode
.visitor
- the visitor to call back.data
- arbitrary data for the visitor.visitor.visit()
calls.RepositoryException
- if an error occurs.public boolean equals(java.lang.Object obj)
true
if obj
is the same type of
QueryNode
as this
node and is equal to
this
node.public boolean needsSystemTree()
true
if this query node needs items under
/jcr:system to be queried.needsSystemTree
in class QueryNode
true
if this query node needs content under
/jcr:system to be queried; false
otherwise.Copyright © 2010 - 2020 Adobe. All Rights Reserved