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

java.lang.Object
  extended by org.apache.directory.shared.ldap.filter.AbstractExprNode
All Implemented Interfaces:
ExprNode
Direct Known Subclasses:
AssertionNode, BranchNode, LeafNode, ScopeNode

public abstract class AbstractExprNode
extends java.lang.Object
implements ExprNode

Abstract implementation of a expression node.

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

Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> annotations
          The map of annotations
protected  AssertionType assertionType
          The node type
 
Constructor Summary
protected AbstractExprNode(AssertionType assertionType)
          Creates a node by setting abstract node type.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.Object key)
          Gets an annotation on the tree by key.
protected  java.util.Map<java.lang.String,java.lang.Object> getAnnotations()
          Gets the annotations as a Map.
 AssertionType getAssertionType()
          Gets the assertion type of this node.
 int hashCode()
           
abstract  boolean isLeaf()
          Tests to see if this node is a leaf or branch node.
 java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
          Default implementation for this method : just throw an exception.
 void set(java.lang.String key, java.lang.Object value)
          Sets a annotation key to a value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.filter.ExprNode
accept
 

Field Detail

annotations

protected java.util.Map<java.lang.String,java.lang.Object> annotations
The map of annotations


assertionType

protected final AssertionType assertionType
The node type

Constructor Detail

AbstractExprNode

protected AbstractExprNode(AssertionType assertionType)
Creates a node by setting abstract node type.

Parameters:
assertionType - The node's type
Method Detail

getAssertionType

public AssertionType getAssertionType()
Description copied from interface: ExprNode
Gets the assertion type of this node. Make it possible to use switch statements on the node type.

Specified by:
getAssertionType in interface ExprNode
Returns:
the node's type
See Also:
ExprNode.getAssertionType()

isLeaf

public abstract boolean isLeaf()
Tests to see if this node is a leaf or branch node.

Specified by:
isLeaf in interface ExprNode
Returns:
true if the node is a leaf,false otherwise

equals

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

hashCode

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

get

public java.lang.Object get(java.lang.Object key)
Description copied from interface: ExprNode
Gets an annotation on the tree by key.

Specified by:
get in interface ExprNode
Parameters:
key - the annotation key.
Returns:
the annotation value.
See Also:
ExprNode.get(java.lang.Object)

set

public void set(java.lang.String key,
                java.lang.Object value)
Description copied from interface: ExprNode
Sets a annotation key to a value.

Specified by:
set in interface ExprNode
Parameters:
key - the annotation key.
value - the annotation value.
See Also:
org.apache.directory.shared.ldap.filter.ExprNode#set(java.lang.Object, java.lang.Object)

getAnnotations

protected java.util.Map<java.lang.String,java.lang.Object> getAnnotations()
Gets the annotations as a Map.

Returns:
the annotation map.

printRefinementToBuffer

public java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
Default implementation for this method : just throw an exception.

Specified by:
printRefinementToBuffer in interface ExprNode
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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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