Class NotNode
- java.lang.Object
-
- org.apache.directory.api.ldap.model.filter.AbstractExprNode
-
- org.apache.directory.api.ldap.model.filter.BranchNode
-
- org.apache.directory.api.ldap.model.filter.NotNode
-
public class NotNode extends BranchNode
Node representing an Not connector in a filter operation- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from class org.apache.directory.api.ldap.model.filter.BranchNode
children
-
Fields inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
annotations, assertionType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(ExprNode node)Adds a child node to this NOT node nodevoidaddNodeToHead(ExprNode node)Adds a child node to this NOT node at the head rather than the tail.AssertionTypegetOperator()Gets the operator for this branch node.booleanisConjunction()Tests whether or not this node is a conjunction (a AND'ed branch).booleanisDisjunction()Tests whether or not this node is a disjunction (a OR'ed branch).booleanisNegation()Tests whether or not this node is a negation (a NOT'ed branch).StringBuilderprintRefinementToBuffer(StringBuilder buf)Default implementation for this method : just throw an exception.voidsetChildren(List<ExprNode> childList)Sets the list of children under this node.StringtoString()Gets the recursive prefix string represent of the filter from this node down.-
Methods inherited from class org.apache.directory.api.ldap.model.filter.BranchNode
accept, clone, equals, getChildren, getFirstChild, hashCode, isLeaf, isSchemaAware
-
Methods inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
get, getAnnotations, getAssertionType, set
-
-
-
-
Constructor Detail
-
NotNode
public NotNode(List<ExprNode> childList)
Creates a NotNode using a logical NOT operator and a list of children. A Not node could contain only one child- Parameters:
childList- the child nodes under this branch node.
-
NotNode
public NotNode(ExprNode child)
Creates a NotNode using a logical NOT operator and the given child.- Parameters:
child- the child node under this branch node.
-
NotNode
public NotNode()
Creates an empty NotNode
-
-
Method Detail
-
addNode
public void addNode(ExprNode node)
Adds a child node to this NOT node node- Overrides:
addNodein classBranchNode- Parameters:
node- the child expression to add to this NOT node
-
addNodeToHead
public void addNodeToHead(ExprNode node)
Adds a child node to this NOT node at the head rather than the tail.- Overrides:
addNodeToHeadin classBranchNode- Parameters:
node- the child expression to add to this branch node
-
setChildren
public void setChildren(List<ExprNode> childList)
Sets the list of children under this node.- Overrides:
setChildrenin classBranchNode- Parameters:
childList- the list of children to set.
-
getOperator
public AssertionType getOperator()
Gets the operator for this branch node.- Returns:
- the operator constant.
-
isDisjunction
public boolean isDisjunction()
Tests whether or not this node is a disjunction (a OR'ed branch).- Returns:
- true if the operation is a OR, false otherwise.
-
isConjunction
public boolean isConjunction()
Tests whether or not this node is a conjunction (a AND'ed branch).- Returns:
- true if the operation is a AND, false otherwise.
-
isNegation
public boolean isNegation()
Tests whether or not this node is a negation (a NOT'ed branch).- Returns:
- true if the operation is a NOT, false otherwise.
-
printRefinementToBuffer
public StringBuilder printRefinementToBuffer(StringBuilder buf)
Description copied from class:AbstractExprNodeDefault implementation for this method : just throw an exception.- Specified by:
printRefinementToBufferin interfaceExprNode- Overrides:
printRefinementToBufferin classAbstractExprNode- Parameters:
buf- the buffer to append to.- Returns:
- The buffer in which the refinement has been appended
- Throws:
UnsupportedOperationException- if this node isn't a part of a refinement.- See Also:
ExprNode.printRefinementToBuffer(StringBuilder)
-
toString
public String toString()
Gets the recursive prefix string represent of the filter from this node down.- Overrides:
toStringin classAbstractExprNode- Returns:
- A string representing the AndNode
- See Also:
Object.toString()
-
-