public class RoleNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<RoleNode> |
children
The children.
|
private int |
id
The id.
|
private java.lang.String |
name
The name.
|
private RoleNode |
parent
The parent.
|
private int |
parentId
The parent id.
|
Constructor and Description |
---|
RoleNode(java.lang.String name,
int id,
int parentId)
Create the node given the name, id, and parentId.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(RoleNode child)
Add a RoleNode child to this RoleNode.
|
java.util.ArrayList<RoleNode> |
getChildren()
Get all the RoleNodes that are children of this RoleNode.
|
int |
getId()
Get the ID of this RoleNode.
|
java.lang.String |
getName()
Get the name of this RoleNode.
|
RoleNode |
getParent()
Get the RoleNode that is the parent of this RoleNode.
|
int |
getParentId()
Get the id of the parent of this RoleNode.
|
void |
getRoleHierarchyAbove(java.util.List<java.lang.String> parentList)
Append a list of the names of all the RoleNodes that exist above this RoleNode in a direct line towards the root.
|
void |
getRoleHierarchyBelow(java.util.List<java.lang.String> childList)
Append a list of the names of all the RoleNodes that exist below this RoleNode (i.e.
|
void |
setParent(RoleNode parent)
Set the RoleNode that is the parent of this RoleNode.
|
void |
toFlexTree(FlexTreeObject ftoParent)
Set the hierarchy as a tree.
|
private RoleNode parent
private java.util.ArrayList<RoleNode> children
private int id
private int parentId
private java.lang.String name
public RoleNode(java.lang.String name, int id, int parentId)
name
- the nameid
- the idparentId
- the parent idpublic void setParent(RoleNode parent)
parent
- the new parentpublic RoleNode getParent()
public java.util.ArrayList<RoleNode> getChildren()
public int getId()
public int getParentId()
public java.lang.String getName()
public void addChild(RoleNode child)
child
- the childpublic void getRoleHierarchyBelow(java.util.List<java.lang.String> childList)
childList
- the Listpublic void getRoleHierarchyAbove(java.util.List<java.lang.String> parentList)
parentList
- the (Listpublic void toFlexTree(FlexTreeObject ftoParent)
ftoParent
- the fto reference that the tree will be built on