org.apache.directory.shared.ldap.filter
Class NotNode

java.lang.Object
  extended by org.apache.directory.shared.ldap.filter.AbstractExprNode
      extended by org.apache.directory.shared.ldap.filter.BranchNode
          extended by org.apache.directory.shared.ldap.filter.NotNode
All Implemented Interfaces:
java.lang.Cloneable, ExprNode

public class NotNode
extends BranchNode

Node representing an Not connector in a filter operation

Version:
$Rev: 517453 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.filter.BranchNode
children
 
Fields inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
annotations, assertionType
 
Constructor Summary
NotNode()
          Creates an empty NotNode
NotNode(ExprNode child)
          Creates a NotNode using a logical NOT operator and the given child.
NotNode(java.util.List<ExprNode> childList)
          Creates a NotNode using a logical NOT operator and a list of children.
 
Method Summary
 void addNode(ExprNode node)
          Adds a child node to this NOT node node
 void addNodeToHead(ExprNode node)
          Adds a child node to this NOT node at the head rather than the tail.
 ExprNode clone()
          Clone the Node
 AssertionType getOperator()
          Gets the operator for this branch node.
 boolean isConjunction()
          Tests whether or not this node is a conjunction (a AND'ed branch).
 boolean isDisjunction()
          Tests whether or not this node is a disjunction (a OR'ed branch).
 boolean isNegation()
          Tests whether or not this node is a negation (a NOT'ed branch).
 java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
          Default implementation for this method : just throw an exception.
 void setChildren(java.util.List<ExprNode> childList)
          Sets the list of children under this node.
 java.lang.String toString()
          Gets the recursive prefix string represent of the filter from this node down.
 
Methods inherited from class org.apache.directory.shared.ldap.filter.BranchNode
accept, equals, getChildren, getFirstChild, hashCode, isLeaf
 
Methods inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
escapeFilterValue, get, getAnnotations, getAssertionType, set
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotNode

public NotNode(java.util.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

clone

public ExprNode clone()
Clone the Node

Specified by:
clone in interface ExprNode
Overrides:
clone in class BranchNode
Returns:
the clone

addNode

public void addNode(ExprNode node)
Adds a child node to this NOT node node

Overrides:
addNode in class BranchNode
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:
addNodeToHead in class BranchNode
Parameters:
node - the child expression to add to this branch node

setChildren

public void setChildren(java.util.List<ExprNode> childList)
Sets the list of children under this node.

Overrides:
setChildren in class BranchNode
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 java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
Description copied from class: AbstractExprNode
Default implementation for this method : just throw an exception.

Specified by:
printRefinementToBuffer in interface ExprNode
Overrides:
printRefinementToBuffer in class AbstractExprNode
Parameters:
buf - the buffer to append to.
Returns:
The buffer in which the refinement has been appended
Throws:
java.lang.UnsupportedOperationException - if this node isn't a part of a refinement.
See Also:
ExprNode#printRefinementToBuffer(StringBuffer)

toString

public java.lang.String toString()
Gets the recursive prefix string represent of the filter from this node down.

Overrides:
toString in class AbstractExprNode
Returns:
A string representing the AndNode
See Also:
Object.toString()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.