Class BranchNode
java.lang.Object
org.apache.directory.api.ldap.model.filter.AbstractExprNode
org.apache.directory.api.ldap.model.filter.BranchNode
Node representing branches within the expression tree corresponding to
logical operators within the filter expression.
- Author:
- Apache Directory Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionchild node list for this branch nodeFields inherited from class AbstractExprNode
annotations, assertionType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBranchNode(AssertionType assertionType) Creates a BranchNode using a logical operator.protectedBranchNode(AssertionType assertionType, List<ExprNode> childList) Creates a BranchNode using a logical operator and a list of children.protectedBranchNode(AssertionType assertionType, ExprNode... childList) Creates a BranchNode using a logical operator and a list of children. -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectaccept(FilterVisitor visitor) Element/node accept method for visitor pattern.voidAdds a child node to this branch node nodevoidaddNodeToHead(ExprNode node) Adds a child node to this branch node at the head rather than the tail.clone()Makes a full clone in new memory space of the current node and childrenbooleanGets the children below this BranchNode.Convenience method that gets the first child in the children array.inthashCode()final booleanisLeaf()Tests to see if this node is a leaf or branch node.booleanTells if this Node is Schema aware.voidsetChildren(List<ExprNode> list) Sets the list of children under this node.Methods inherited from class AbstractExprNode
get, getAnnotations, getAssertionType, printRefinementToBuffer, set, toString
-
Field Details
-
children
-
-
Constructor Details
-
BranchNode
Creates a BranchNode using a logical operator and a list of children.- Parameters:
assertionType- the node's typechildList- the child nodes under this branch node.
-
BranchNode
Creates a BranchNode using a logical operator and a list of children.- Parameters:
assertionType- the node's typechildList- the child nodes under this branch node.
-
BranchNode
Creates a BranchNode using a logical operator.- Parameters:
assertionType- the node's type
-
-
Method Details
-
isLeaf
public final boolean isLeaf()Description copied from interface:ExprNodeTests to see if this node is a leaf or branch node.- Returns:
- false all the time.
- See Also:
-
clone
Makes a full clone in new memory space of the current node and children- Specified by:
clonein interfaceExprNode- Overrides:
clonein classAbstractExprNode- Returns:
- the clone
-
addNode
Adds a child node to this branch node node- Parameters:
node- the child expression to add to this branch node
-
addNodeToHead
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
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
-
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
Description copied from interface:ExprNodeElement/node accept method for visitor pattern.- Parameters:
visitor- the filter expression tree structure visitor- Returns:
- The modified element
- See Also:
-
isSchemaAware
public boolean isSchemaAware()Tells if this Node is Schema aware.- Returns:
- true if the Node is SchemaAware
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractExprNode- Returns:
- the instance's hash code
- See Also:
-
equals
- Overrides:
equalsin classAbstractExprNode- Returns:
trueif both objects are equal- See Also:
-