org.apache.directory.api.ldap.model.filter
Class SimpleNode<T>

java.lang.Object
  extended by org.apache.directory.api.ldap.model.filter.AbstractExprNode
      extended by org.apache.directory.api.ldap.model.filter.LeafNode
          extended by org.apache.directory.api.ldap.model.filter.SimpleNode<T>
All Implemented Interfaces:
Cloneable, ExprNode
Direct Known Subclasses:
ApproximateNode, EqualityNode, GreaterEqNode, LessEqNode

public abstract class SimpleNode<T>
extends LeafNode

A simple assertion value node.

Author:
Apache Directory Project

Field Summary
static boolean EVAL_GREATER
          Constants for comparisons : >
static boolean EVAL_LESSER
          Constants for comparisons : <
protected  Value<T> value
          the value
 
Fields inherited from class org.apache.directory.api.ldap.model.filter.LeafNode
attribute, attributeType
 
Fields inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
annotations, assertionType, isSchemaAware
 
Constructor Summary
protected SimpleNode(AttributeType attributeType, Value<T> value, AssertionType assertionType)
          Creates a new SimpleNode object.
protected SimpleNode(String attribute, Value<T> value, AssertionType assertionType)
          Creates a new SimpleNode object.
 
Method Summary
 ExprNode clone()
          Makes a full clone in new memory space of the current node and children
 boolean equals(Object other)
           
 Value<?> getEscapedValue()
           
 Value<T> getValue()
          Gets the value.
 int hashCode()
           
 StringBuilder printRefinementToBuffer(StringBuilder buf)
          Default implementation for this method : just throw an exception.
 StringBuilder printToBuffer(StringBuilder buf)
          Pretty prints this expression node along with annotation information.
 void setValue(Value<T> value)
          Sets the value of this node.
 
Methods inherited from class org.apache.directory.api.ldap.model.filter.LeafNode
accept, getAttribute, getAttributeType, isLeaf, setAttribute, setAttributeType
 
Methods inherited from class org.apache.directory.api.ldap.model.filter.AbstractExprNode
escapeFilterValue, get, getAnnotations, getAssertionType, isSchemaAware, set, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected Value<T> value
the value


EVAL_GREATER

public static final boolean EVAL_GREATER
Constants for comparisons : >

See Also:
Constant Field Values

EVAL_LESSER

public static final boolean EVAL_LESSER
Constants for comparisons : <

See Also:
Constant Field Values
Constructor Detail

SimpleNode

protected SimpleNode(String attribute,
                     Value<T> value,
                     AssertionType assertionType)
Creates a new SimpleNode object.

Parameters:
attribute - the attribute name
value - the value to test for
assertionType - the type of assertion represented by this ExprNode

SimpleNode

protected SimpleNode(AttributeType attributeType,
                     Value<T> value,
                     AssertionType assertionType)
Creates a new SimpleNode object.

Parameters:
attribute - the attribute name
value - the value to test for
assertionType - the type of assertion represented by this ExprNode
Method Detail

clone

public ExprNode clone()
Makes a full clone in new memory space of the current node and children

Specified by:
clone in interface ExprNode
Overrides:
clone in class AbstractExprNode
Returns:
the cloned expression node

getValue

public final Value<T> getValue()
Gets the value.

Returns:
the value

getEscapedValue

public Value<?> getEscapedValue()
Returns:
representation of value, escaped for use in a filter if required

setValue

public void setValue(Value<T> value)
Sets the value of this node.

Parameters:
value - the value for this node

printToBuffer

public StringBuilder printToBuffer(StringBuilder buf)
Pretty prints this expression node along with annotation information. TODO - perhaps this belong in some utility class?

Parameters:
buf - the buffer to print into
Returns:
the same buf argument returned for call chaining

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

hashCode

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

equals

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


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