|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.util.tree.DnBranchNode<N>
public class DnBranchNode<N>
The Hierarchical Container holds elements ordered by their DN.
We can see them as directories, where the leaves are the files.
This class is *not* thread safe
Constructor Summary | |
---|---|
DnBranchNode()
Creates a new instance of a DnBranchNode. |
Method Summary | |
---|---|
void |
add(DN dn,
N element)
TODO add. |
DnNode<N> |
addNode(java.lang.String rdn,
DnNode<N> child)
Directly adds a new child DnNode to the current DnBranchNode. |
boolean |
contains(java.lang.String rdn)
Tells if the current DnBranchNode contains another node associated with an rdn. |
DnNode<N> |
getChild(java.lang.String rdn)
Get's a child using an rdn string. |
N |
getParentElement(DN dn)
Get the parent of a given DN, if present in the tree. |
boolean |
hasChildren()
Tells if a branchNode has some children or not |
boolean |
hasParentElement(DN dn)
Tells if the DN contains a parent in the tree. |
boolean |
isLeaf()
Tells if the implementation is a leaf node. |
void |
remove(N element)
Removes an element from the tree. |
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 |
---|
public DnBranchNode()
Method Detail |
---|
public boolean isLeaf()
DnNode
isLeaf
in interface DnNode<N>
true
if the class is a leaf node, false otherwise.DnNode.isLeaf()
public DnNode<N> addNode(java.lang.String rdn, DnNode<N> child)
rdn
- The rdn of the child node to addchild
- The child node to add
public boolean contains(java.lang.String rdn)
rdn
- The name we are looking for
true
if the tree instance contains this namepublic DnNode<N> getChild(java.lang.String rdn)
rdn
- the rdn to use as the node key
public N getParentElement(DN dn)
dn
- the normalized distinguished name to resolve to a parent
public boolean hasParentElement(DN dn)
dn
- the normalized distinguished name to resolve to a parent
public boolean hasChildren()
true
if the node has some childrenpublic void add(DN dn, N element) throws LdapException
dn
- element
-
NamingException
LdapException
public void remove(N element)
element
- The element to removepublic int size()
size
in interface DnNode<N>
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |