org.apache.directory.api.ldap.model.filter
Class OrNode

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

public class OrNode
extends BranchNode

Node representing an OR 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, isSchemaAware
 
Constructor Summary
OrNode()
          Creates an empty OrNode
OrNode(ExprNode... childList)
          Creates a OrNode using a logical operator and a list of children.
OrNode(List<ExprNode> childList)
          Creates a OrNode using a logical operator and a list of children.
 
Method Summary
 boolean equals(Object other)
           
 AssertionType getOperator()
          Gets the operator for this branch node.
 int hashCode()
           
 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).
 StringBuilder printRefinementToBuffer(StringBuilder buf)
          Default implementation for this method : just throw an exception.
 String toString()
          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, addNode, addNodeToHead, clone, getChildren, getFirstChild, isLeaf, setChildren
 
Methods inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
escapeFilterValue, get, getAnnotations, getAssertionType, isSchemaAware, set
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrNode

public OrNode(List<ExprNode> childList)
Creates a OrNode using a logical operator and a list of children.

Parameters:
childList - the child nodes under this branch node.

OrNode

public OrNode(ExprNode... childList)
Creates a OrNode using a logical operator and a list of children.

Parameters:
childList - the child nodes under this branch node.

OrNode

public OrNode()
Creates an empty OrNode

Method Detail

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: 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:
UnsupportedOperationException - if this node isn't a part of a refinement.
See Also:
ExprNode#printRefinementToBuffer(StringBuffer)

toString

public 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()

hashCode

public int hashCode()
Overrides:
hashCode in class BranchNode
Returns:
the instance's hash code
See Also:
Object.hashCode()

equals

public boolean equals(Object other)
Overrides:
equals in class BranchNode
Returns:
true if both objects are equal
See Also:
Object.equals(java.lang.Object)


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.