Package org.europa.together.domain
Class TreeNode<T>
java.lang.Object
org.europa.together.domain.TreeNode<T>
- Type Parameters:
T
- as generic Class
Data structure for a tree.A node is unique by is UUID, but in real
environments is a more specified definition necessary. A parent node can not
have two child nods with the same name. for a user is then hard to
distinguish which child node is the right one. (e.g. Files and Folders)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClone (copy) a TreeNode to a we instance.boolean
Get the name of the node.Get the UUID of the parent node.getUuid()
Get the UUID of the node.getValue()
Get the value of a node.int
hashCode()
void
setNodeName
(String nodeName) Set the name of the node.void
Set the UUID of the parent node.void
Set the value of a node.toString()
-
Constructor Details
-
TreeNode
public TreeNode()Constructor. -
TreeNode
Constructor.- Parameters:
name
- as String
-
-
Method Details
-
getNodeName
Get the name of the node.- Returns:
- name as String
-
setNodeName
Set the name of the node.- Parameters:
nodeName
- as String
-
getParent
Get the UUID of the parent node.- Returns:
- UUID as String
-
setParent
Set the UUID of the parent node.- Parameters:
parent
- as String
-
getValue
Get the value of a node.- Returns:
- value as Object
-
setValue
Set the value of a node.- Parameters:
value
- as Object
-
getUuid
Get the UUID of the node.- Returns:
- uuid as String
-
copy
Clone (copy) a TreeNode to a we instance.- Parameters:
node
- as TreeNode- Returns:
- a copy of the TreeNode
-
toString
-
hashCode
public int hashCode() -
equals
-