Package de.alpharogroup.swing.tree.model
Class AbstractGenericTreeNode<T>
- java.lang.Object
-
- de.alpharogroup.swing.tree.model.AbstractGenericTreeNode<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractGenericTreeNode()Instantiates a new tree node.AbstractGenericTreeNode(T value)Instantiates a new tree node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(ITreeNode<T> child)Adds the child.voidaddChildAt(int index, ITreeNode<T> child)Adds the child.booleanequals(ITreeNode<T> treeNode)Equals.intgetChildCount()Gets the child count.java.util.List<ITreeNode<T>>getChildren()Gets the children.TgetValue()Gets the value.booleanhasChildren()(non-Javadoc).inthashCode()(non-Javadoc).booleanisLeaf()(non-Javadoc).booleanisNode()(non-Javadoc).voidremoveChild(ITreeNode<T> child)Removes the child.voidremoveChildAt(int index)Removes the child.voidsetChildren(java.util.List<ITreeNode<T>> children)Sets the children.voidsetValue(T value)Sets the value.java.util.List<ITreeNode<T>>toList()To list.voidtraverse(ITreeNode<T> node, java.util.List<ITreeNode<T>> list)Traverse.
-
-
-
Constructor Detail
-
AbstractGenericTreeNode
public AbstractGenericTreeNode()
Instantiates a new tree node.
-
AbstractGenericTreeNode
public AbstractGenericTreeNode(T value)
Instantiates a new tree node.- Parameters:
value- the value
-
-
Method Detail
-
addChildAt
public void addChildAt(int index, ITreeNode<T> child) throws java.lang.IndexOutOfBoundsExceptionAdds the child.- Specified by:
addChildAtin interfaceITreeNode<T>- Parameters:
index- the indexchild- the child- Throws:
java.lang.IndexOutOfBoundsException- the index out of bounds exception
-
getChildCount
public int getChildCount()
Gets the child count.- Specified by:
getChildCountin interfaceITreeNode<T>- Returns:
- the child count
-
getChildren
public java.util.List<ITreeNode<T>> getChildren()
Gets the children.- Specified by:
getChildrenin interfaceITreeNode<T>- Returns:
- the children
-
getValue
public T getValue()
Gets the value.
-
hasChildren
public boolean hasChildren()
(non-Javadoc).- Specified by:
hasChildrenin interfaceITreeNode<T>- Returns:
- true, if successful
- See Also:
ITreeNode.hasChildren()
-
hashCode
public int hashCode()
(non-Javadoc).- Overrides:
hashCodein classjava.lang.Object- Returns:
- the int
- See Also:
Object.hashCode()
-
isLeaf
public boolean isLeaf()
(non-Javadoc).- Specified by:
isLeafin interfaceITreeNode<T>- Returns:
- true, if is leaf
- See Also:
ITreeNode.isLeaf()
-
isNode
public boolean isNode()
(non-Javadoc).- Specified by:
isNodein interfaceITreeNode<T>- Returns:
- true, if is node
- See Also:
ITreeNode.isNode()
-
removeChild
public void removeChild(ITreeNode<T> child)
Removes the child.- Specified by:
removeChildin interfaceITreeNode<T>- Parameters:
child- the child
-
removeChildAt
public void removeChildAt(int index) throws java.lang.IndexOutOfBoundsExceptionRemoves the child.- Specified by:
removeChildAtin interfaceITreeNode<T>- Parameters:
index- the index- Throws:
java.lang.IndexOutOfBoundsException- the index out of bounds exception
-
setChildren
public void setChildren(java.util.List<ITreeNode<T>> children)
Sets the children.- Specified by:
setChildrenin interfaceITreeNode<T>- Parameters:
children- the new children
-
setValue
public void setValue(T value)
Sets the value.
-
-