org.apache.directory.shared.ldap.util.tree
Class DnLeafNode<N>

java.lang.Object
  extended by org.apache.directory.shared.ldap.util.tree.DnLeafNode<N>
All Implemented Interfaces:
DnNode<N>

public class DnLeafNode<N>
extends java.lang.Object
implements DnNode<N>

A leaf node which stores an element. These objects are stored in BranchNodes.

Author:
Apache Directory Project

Constructor Summary
DnLeafNode(N element)
          Creates a new instance of DnLeafNode.
 
Method Summary
 N getElement()
           
 boolean isLeaf()
          Tells if the implementation is a leaf node.
 int size()
          Returns the number of entries under this node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DnLeafNode

public DnLeafNode(N element)
Creates a new instance of DnLeafNode.

Parameters:
element - the element to store
Method Detail

isLeaf

public boolean isLeaf()
Description copied from interface: DnNode
Tells if the implementation is a leaf node. If it's a branch node then false is returned.

Specified by:
isLeaf in interface DnNode<N>
Returns:
true if the class is a leaf node, false otherwise.
See Also:
DnNode.isLeaf()

getElement

public N getElement()
Returns:
Return the stored element

size

public int size()
Returns the number of entries under this node. It includes the node itself, plus the sum of all it children and descendents.

Specified by:
size in interface DnNode<N>
Returns:
The number of descendents

toString

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


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