public class Tree
extends java.lang.Object
Constructor and Description |
---|
Tree()
Creates an empty Tree object.
|
Tree(List treeList)
Creates a Tree object that stores a passed List of Tree objects.
|
Tree(List treeList,
boolean allowNull)
Creates a Tree object that stores a passed List of Tree objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addTree(Tree t)
Adds the specified Tree object to treeList and increases subTreeCount by 1 to keep it synchronized.
|
java.lang.Object |
getContent()
Returns the content of the Tree object.
|
int |
getSubTreeCount()
Returns the amount of elements in treeList.
|
Tree |
getTree(int index)
Returns the tree with the specified index, starting from 0.
|
List |
getTrees()
Deprecated.
this is only for easier testing purposes but modifying the internal list via this call may
invalidate the integrity of the synchronization between treeList and subTreeCount.
|
void |
removeTree(int index)
Removes the specified Tree object from treeList and decreases subTreeCount by 1 to keep it synchronized.
|
void |
setContent(java.lang.Object content)
Sets the content of the Tree object.
|
public Tree()
public Tree(List treeList)
treeList
- a List of Tree objects.public Tree(List treeList, boolean allowNull)
treeList
- a List of Tree objects.allowNull
- whether null values shall be kept and take a slot in the list.public void addTree(Tree t)
t
- a Tree object.public void removeTree(int index)
index
- the index of the tree object to delete, starting from 0.public java.lang.Object getContent()
public void setContent(java.lang.Object content)
content
- the content of the Tree object.public Tree getTree(int index)
index
- the index of the desired Tree object.@Deprecated public List getTrees()
public int getSubTreeCount()