public class GroupZipper extends Object
Group objects.
It is kind of an iterator with a pointer to the current element. The current element can be found with
getNode() method.
Navigation through the tree is possible with the methods down() up() left() right().
The tree can also be modified by using the replace(Group) method to replace a node with another one.
| Constructor and Description |
|---|
GroupZipper(KeePassFile keePassFile)
Create a zipper with the tree structure of the given KeePass file.
|
| Modifier and Type | Method and Description |
|---|---|
KeePassFile |
close()
Returns a new
KeePassFile from the current tree structure. |
GroupZipper |
down()
Navigates down the tree to the first child node of the current node.
|
Group |
getNode()
Returns the current node.
|
Group |
getRoot()
Returns the root node of the tree.
|
GroupZipper |
left()
Navigates left the tree to the previous node at the same level.
|
GroupZipper |
replace(Group group)
Replaces the current node with the given one.
|
GroupZipper |
replaceMeta(Meta meta)
Replaces the meta with the given one.
|
GroupZipper |
right()
Navigates right the tree to the next node at the same level.
|
GroupZipper |
up()
Navigates up the tree to the parent node of the current node.
|
public GroupZipper(KeePassFile keePassFile)
keePassFile - the underlying data structurepublic GroupZipper down()
If the current node has no childs an exception will be thrown.
RuntimeException - if the current node has no child nodespublic GroupZipper up()
If the current node has no parent an exception will be thrown.
RuntimeException - if the current node has no parent nodepublic GroupZipper right()
public GroupZipper left()
public Group getNode()
public GroupZipper replace(Group group)
Can be used to modify the tree.
group - the replacement nodepublic KeePassFile close()
KeePassFile from the current tree structure.public Group getRoot()
public GroupZipper replaceMeta(Meta meta)
meta - the given meta objectCopyright © 2016. All rights reserved.