|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.ldap.util.tree.DnNode<N>
N - The type of node we storepublic class DnNode<N>
A class storing nodes in a tree designed to map DNs.
Branch nodes in this tree refers to child nodes. Leaf nodes in the tree
don't have any children.
A node may contain a reference to an object whose suffix is the path through the
nodes of the tree from the root.
A node may also have no attached element.
Each child node is referenced by a Rdn, and holds the full Dn corresponding to its position
| Constructor Summary | |
|---|---|
DnNode()
Creates a new instance of DnNode. |
|
DnNode(org.apache.directory.api.ldap.model.name.Dn dn,
N element)
Creates a new instance of DnNode. |
|
DnNode(N element)
Creates a new instance of DnNode. |
|
| Method Summary | |
|---|---|
void |
add(org.apache.directory.api.ldap.model.name.Dn dn)
Add a new node in the tree. |
void |
add(org.apache.directory.api.ldap.model.name.Dn dn,
N element)
Add a new node in the tree. |
DnNode<N> |
clone()
|
boolean |
contains(org.apache.directory.api.ldap.model.name.Rdn rdn)
Tells if the current DnBranchNode contains another node associated with an rdn. |
DnNode<N> |
getChild(org.apache.directory.api.ldap.model.name.Rdn rdn)
Get's a child using an rdn string. |
Map<org.apache.directory.api.ldap.model.name.Rdn,DnNode<N>> |
getChildren()
|
List<N> |
getDescendantElements(org.apache.directory.api.ldap.model.name.Dn dn)
|
org.apache.directory.api.ldap.model.name.Dn |
getDn()
|
N |
getElement()
|
N |
getElement(org.apache.directory.api.ldap.model.name.Dn dn)
|
DnNode<N> |
getNode(org.apache.directory.api.ldap.model.name.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(org.apache.directory.api.ldap.model.name.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. |
org.apache.directory.api.ldap.model.name.Rdn |
getRdn()
|
boolean |
hasChildren()
Tells if the current DnNode has some children or not |
boolean |
hasChildren(org.apache.directory.api.ldap.model.name.Dn dn)
Tells if a node has some children or not. |
boolean |
hasDescendantElement(org.apache.directory.api.ldap.model.name.Dn dn)
|
boolean |
hasElement()
|
boolean |
hasElement(org.apache.directory.api.ldap.model.name.Dn dn)
|
boolean |
hasParent()
|
boolean |
hasParent(org.apache.directory.api.ldap.model.name.Dn dn)
Tells if there is a parent for a given Dn,. |
boolean |
hasParentElement(org.apache.directory.api.ldap.model.name.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(org.apache.directory.api.ldap.model.name.Dn dn)
Tells if the implementation is a leaf node. |
void |
move(org.apache.directory.api.ldap.model.name.Dn newParent)
move the DnNode's Dn |
void |
remove(org.apache.directory.api.ldap.model.name.Dn dn)
Removes a node from the tree. |
void |
rename(org.apache.directory.api.ldap.model.name.Rdn newRdn)
rename the DnNode's Dn |
int |
size()
Returns the number of entries under this node. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DnNode()
public DnNode(N element)
element - the element to store
public DnNode(org.apache.directory.api.ldap.model.name.Dn dn,
N element)
dn - the node's Dnelement - the element to store| Method Detail |
|---|
public boolean isLeaf()
true if the class is a leaf node, false otherwise.public boolean isLeaf(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The Dn we want to check
true if this is a leaf node, false otherwise.public int size()
public N getElement()
public N getElement(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The Dn we want to get the element for
public boolean hasElement()
public boolean hasElement(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The Dn we want to get the element for
public boolean hasDescendantElement(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The Dn we want to get the element for
public List<N> getDescendantElements(org.apache.directory.api.ldap.model.name.Dn dn)
dn - The Dn we want to get the element for
public boolean hasChildren()
true if the node has some children
public boolean hasChildren(org.apache.directory.api.ldap.model.name.Dn dn)
throws org.apache.directory.api.ldap.model.exception.LdapException
dn - the node's Dn
true if the node has some children
org.apache.directory.api.ldap.model.exception.LdapException - if the Dn is null or emptypublic Map<org.apache.directory.api.ldap.model.name.Rdn,DnNode<N>> getChildren()
public DnNode<N> getParent()
public boolean hasParent()
public boolean hasParent(org.apache.directory.api.ldap.model.name.Dn dn)
dn - the normalized distinguished name to resolve to a parent
public void add(org.apache.directory.api.ldap.model.name.Dn dn)
throws org.apache.directory.api.ldap.model.exception.LdapException
dn - The node's Dn
org.apache.directory.api.ldap.model.exception.LdapException - if the Dn is null or empty
public void add(org.apache.directory.api.ldap.model.name.Dn dn,
N element)
throws org.apache.directory.api.ldap.model.exception.LdapException
dn - The node's Dnelement - The element to associate with this Node. Can be null.
org.apache.directory.api.ldap.model.exception.LdapException - if the Dn is null or empty
public void remove(org.apache.directory.api.ldap.model.name.Dn dn)
throws org.apache.directory.api.ldap.model.exception.LdapException
dn - the node's Dn
org.apache.directory.api.ldap.model.exception.LdapException - if the Dn is null or emptypublic boolean contains(org.apache.directory.api.ldap.model.name.Rdn rdn)
rdn - The name we are looking for
true if the tree instance contains this namepublic DnNode<N> getChild(org.apache.directory.api.ldap.model.name.Rdn rdn)
rdn - the rdn to use as the node key
public org.apache.directory.api.ldap.model.name.Rdn getRdn()
public DnNode<N> getNode(org.apache.directory.api.ldap.model.name.Dn dn)
dn - the normalized distinguished name to resolve to a parent
public boolean hasParentElement(org.apache.directory.api.ldap.model.name.Dn dn)
dn - the normalized distinguished name to resolve to a parent
public DnNode<N> getParentWithElement(org.apache.directory.api.ldap.model.name.Dn dn)
dn - the normalized distinguished name to resolve to a parent
public DnNode<N> getParentWithElement()
dn - the normalized distinguished name to resolve to a parent
public void rename(org.apache.directory.api.ldap.model.name.Rdn newRdn)
throws org.apache.directory.api.ldap.model.exception.LdapException
newRdn - the new Rdn of this node
org.apache.directory.api.ldap.model.exception.LdapException
public void move(org.apache.directory.api.ldap.model.name.Dn newParent)
throws org.apache.directory.api.ldap.model.exception.LdapException
newParent - the new parent Dn
org.apache.directory.api.ldap.model.exception.LdapExceptionpublic DnNode<N> clone()
clone in class Objectpublic String toString()
toString in class Objectpublic org.apache.directory.api.ldap.model.name.Dn getDn()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||