org.apache.directory.server.core.partition.tree
Class BranchNode

java.lang.Object
  extended by org.apache.directory.server.core.partition.tree.BranchNode
All Implemented Interfaces:
Node

public class BranchNode
extends java.lang.Object
implements Node

The Partition Container holds entries which can be either Partitions or Containers. We can see them as directories, where Partitions are the files.

Author:
Apache Directory Project

Constructor Summary
BranchNode()
          Creates a new instance of a BranchNode.
 
Method Summary
 BranchNode addNode(java.lang.String rdn, Node child)
          Directly adds a new child Node to the current BranchNode.
 boolean contains(java.lang.String rdn)
          Tells if the current BranchNode contains another node associated with an rdn.
 Node getChild(java.lang.String rdn)
          Get's a child using an rdn string.
 boolean isLeaf()
          Tells if the implementation is a leaf node.
 BranchNode recursivelyAddPartition(BranchNode current, org.apache.directory.shared.ldap.name.LdapDN dn, int index, Partition partition)
          Recursively adds new nodes to the partition lookup tree data structure.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BranchNode

public BranchNode()
Creates a new instance of a BranchNode.

Method Detail

isLeaf

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

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

recursivelyAddPartition

public BranchNode recursivelyAddPartition(BranchNode current,
                                          org.apache.directory.shared.ldap.name.LdapDN dn,
                                          int index,
                                          Partition partition)
                                   throws javax.naming.NamingException
Recursively adds new nodes to the partition lookup tree data structure. When called it will add a partition to the tree in the appropriate leaf node position based on the DN passed in as an argument.

Parameters:
current - The current node having a partition added to it
dn - The DN associated with the partition
index - The index of the current RDN being processed
partition - The associated partition to add as a tree node
Returns:
The modified tree structure.
Throws:
javax.naming.NamingException

addNode

public BranchNode addNode(java.lang.String rdn,
                          Node child)
Directly adds a new child Node to the current BranchNode.

Parameters:
rdn - The rdn of the child node to add
child - The child node to add
Returns:
The modified branch node after the insertion

contains

public boolean contains(java.lang.String rdn)
Tells if the current BranchNode contains another node associated with an rdn.

Parameters:
rdn - The name we are looking for
Returns:
true if the PartitionStructure instance contains this name

getChild

public Node getChild(java.lang.String rdn)
Get's a child using an rdn string.

Parameters:
rdn - the rdn to use as the node key
Returns:
the child node corresponding to the rdn.

toString

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


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