N
- The type of node we storepublic class DnNode<N> extends Object
Constructor and Description |
---|
DnNode()
Creates a new instance of DnNode.
|
DnNode(Dn dn,
N element)
Creates a new instance of DnNode.
|
DnNode(N element)
Creates a new instance of DnNode.
|
Modifier and Type | Method and Description |
---|---|
DnNode<N> |
add(Dn dn)
Add a new node in the tree.
|
DnNode<N> |
add(Dn dn,
N element)
Add a new node in the tree.
|
boolean |
contains(Rdn rdn)
Tells if the current DnBranchNode contains another node associated
with an rdn.
|
DnNode<N> |
getChild(Rdn rdn)
Get's a child using an rdn string.
|
Map<String,DnNode<N>> |
getChildren() |
List<N> |
getDescendantElements(Dn dn) |
Dn |
getDn() |
N |
getElement() |
N |
getElement(Dn dn) |
DnNode<N> |
getNode(Dn dn)
Get the Node for a given Dn, if present in the tree.
For instance, if we have stored dc=acme, dc=org into the tree, the Dn: ou=example, dc=acme, dc=org will have a parent, and dc=acme, dc=org will be returned. |
DnNode<N> |
getParent() |
DnNode<N> |
getParentWithElement()
Get the closest Node for a given Dn which has an element, if present in the tree.
For instance, if we have stored dc=acme, dc=org into the tree, the Dn: ou=example, dc=acme, dc=org will have a parent, and dc=acme, dc=org will be returned if it has an associated element. |
DnNode<N> |
getParentWithElement(Dn dn)
Get the closest Node for a given Dn which has an element, if present in the tree.
For instance, if we have stored dc=acme, dc=org into the tree, the Dn: ou=example, dc=acme, dc=org will have a parent, and dc=acme, dc=org will be returned if it has an associated element. |
Rdn |
getRdn() |
boolean |
hasChildren()
Tells if the current DnNode has some children or not
|
boolean |
hasChildren(Dn dn)
Tells if a node has some children or not.
|
boolean |
hasDescendantElement(Dn dn) |
boolean |
hasElement() |
boolean |
hasElement(Dn dn) |
boolean |
hasParent() |
boolean |
hasParent(Dn dn)
Tells if there is a parent for a given Dn,.
|
boolean |
hasParentElement(Dn dn)
Get the closest Node for a given Dn which has an element, if present in the tree.
For instance, if we have stored dc=acme, dc=org into the tree, the Dn: ou=example, dc=acme, dc=org will have a parent, and dc=acme, dc=org will be returned if it has an associated element. |
boolean |
isLeaf()
Tells if the implementation is a leaf node.
|
boolean |
isLeaf(Dn dn)
Tells if the implementation is a leaf node.
|
void |
move(Dn newParent)
move the DnNode's Dn
|
void |
remove(Dn dn)
Removes a node from the tree.
|
void |
rename(Rdn newRdn)
rename the DnNode's Dn
|
int |
size()
Returns the number of entries under this node.
|
String |
toString() |
public DnNode()
public DnNode(N element)
element
- the element to storepublic boolean isLeaf()
true
if the class is a leaf node, false otherwise.public boolean isLeaf(Dn dn)
dn
- The Dn we want to checktrue
if this is a leaf node, false otherwise.public int size()
public N getElement()
public N getElement(Dn dn)
dn
- The Dn we want to get the element forpublic boolean hasElement()
public boolean hasElement(Dn dn)
dn
- The Dn we want to get the element forpublic boolean hasDescendantElement(Dn dn)
dn
- The Dn we want to get the element forpublic List<N> getDescendantElements(Dn dn)
dn
- The Dn we want to get the element forpublic boolean hasChildren()
true
if the node has some childrenpublic boolean hasChildren(Dn dn) throws LdapException
dn
- the node's Dntrue
if the node has some childrenLdapException
- if the Dn is null or emptypublic Map<String,DnNode<N>> getChildren()
public boolean hasParent()
public boolean hasParent(Dn dn)
dn
- the normalized distinguished name to resolve to a parentpublic DnNode<N> add(Dn dn) throws LdapException
dn
- The node's DnLdapException
- if the Dn is null or emptypublic DnNode<N> add(Dn dn, N element) throws LdapException
dn
- The node's Dnelement
- The element to associate with this Node. Can be null.LdapException
- if the Dn is null or emptypublic void remove(Dn dn) throws LdapException
dn
- the node's DnLdapException
- if the Dn is null or emptypublic boolean contains(Rdn rdn)
rdn
- The name we are looking fortrue
if the tree instance contains this namepublic DnNode<N> getChild(Rdn rdn)
rdn
- the rdn to use as the node keypublic DnNode<N> getNode(Dn dn)
dn
- the normalized distinguished name to resolve to a parentpublic boolean hasParentElement(Dn dn)
dn
- the normalized distinguished name to resolve to a parentpublic DnNode<N> getParentWithElement(Dn dn)
dn
- the normalized distinguished name to resolve to a parentpublic DnNode<N> getParentWithElement()
public void rename(Rdn newRdn) throws LdapException
newRdn
- the new Rdn of this nodeLdapException
- If the rename failedpublic void move(Dn newParent) throws LdapException
newParent
- the new parent DnLdapException
- If the move failedCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.