Class BranchNode
- java.lang.Object
-
- org.apache.directory.api.ldap.model.filter.AbstractExprNode
-
- org.apache.directory.api.ldap.model.filter.BranchNode
-
public abstract class BranchNode extends AbstractExprNode
Node representing branches within the expression tree corresponding to logical operators within the filter expression.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accept(FilterVisitor visitor)
Element/node accept method for visitor pattern.void
addNode(ExprNode node)
Adds a child node to this branch node nodevoid
addNodeToHead(ExprNode node)
Adds a child node to this branch node at the head rather than the tail.ExprNode
clone()
Makes a full clone in new memory space of the current node and childrenboolean
equals(Object other)
List<ExprNode>
getChildren()
Gets the children below this BranchNode.ExprNode
getFirstChild()
Convenience method that gets the first child in the children array.int
hashCode()
boolean
isLeaf()
Tests to see if this node is a leaf or branch node.boolean
isSchemaAware()
Tells if this Node is Schema aware.void
setChildren(List<ExprNode> list)
Sets the list of children under this node.-
Methods inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
get, getAssertionType, printRefinementToBuffer, set, toString
-
-
-
-
Method Detail
-
isLeaf
public final boolean isLeaf()
Description copied from interface:ExprNode
Tests to see if this node is a leaf or branch node.- Returns:
- false all the time.
- See Also:
ExprNode.isLeaf()
-
clone
public ExprNode clone()
Makes a full clone in new memory space of the current node and children- Specified by:
clone
in interfaceExprNode
- Overrides:
clone
in classAbstractExprNode
- Returns:
- the clone
-
addNode
public void addNode(ExprNode node)
Adds a child node to this branch node node- Parameters:
node
- the child expression to add to this branch node
-
addNodeToHead
public void addNodeToHead(ExprNode node)
Adds a child node to this branch node at the head rather than the tail.- Parameters:
node
- the child expression to add to this branch node
-
getChildren
public List<ExprNode> getChildren()
Gets the children below this BranchNode. We purposefully do not clone the array list so that backends can sort the order of children using their own search optimization algorithms. We want backends and other parts of the system to be able to induce side effects on the tree structure.- Returns:
- the list of child nodes under this branch node.
-
setChildren
public void setChildren(List<ExprNode> list)
Sets the list of children under this node.- Parameters:
list
- the list of children to set.
-
getFirstChild
public ExprNode getFirstChild()
Convenience method that gets the first child in the children array. Its very useful for NOT nodes since they only have one child by avoiding code that looks like:( ExprNode ) m_children.get( 0 )
- Returns:
- the first child
-
accept
public final Object accept(FilterVisitor visitor)
Description copied from interface:ExprNode
Element/node accept method for visitor pattern.- Parameters:
visitor
- the filter expression tree structure visitor- Returns:
- The modified element
- See Also:
ExprNode.accept( FilterVisitor)
-
isSchemaAware
public boolean isSchemaAware()
Tells if this Node is Schema aware.- Returns:
- true if the Node is SchemaAware
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractExprNode
- Returns:
- the instance's hash code
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classAbstractExprNode
- Returns:
true
if both objects are equal- See Also:
Object.equals(java.lang.Object)
-
-