Package cz.vutbr.fit.layout.impl
Class DefaultTreeNode<T extends GenericTreeNode<T>>
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.DefaultTreeNode<T>
-
- All Implemented Interfaces:
GenericTreeNode<T>
- Direct Known Subclasses:
DefaultLogicalArea,DefaultTreeContentRect
public class DefaultTreeNode<T extends GenericTreeNode<T>> extends Object implements GenericTreeNode<T>
A generic tree node used as a base for the Box and Area implementation.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description DefaultTreeNode(Class<T> myType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendChild(T child)voidappendChildren(List<T> list)intgetDepth()TgetChildAt(int index)intgetChildCount()List<T>getChildren()intgetIndex(T child)intgetLeafCount()TgetNextSibling()TgetParent()TgetPreviousSibling()TgetRoot()voidchildrenChanged()This method is called after some child nodes have been added or removed.voidinsertChild(T child, int index)booleanisLeaf()booleanisRoot()voidremoveAllChildren()voidremoveChild(int index)voidremoveChild(T child)voidsetParent(T parent)voidsetRoot(T root)
-
-
-
Method Detail
-
getParent
public T getParent()
- Specified by:
getParentin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
setParent
public void setParent(T parent)
- Specified by:
setParentin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getRoot
public T getRoot()
- Specified by:
getRootin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
setRoot
public void setRoot(T root)
- Specified by:
setRootin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
isRoot
public boolean isRoot()
- Specified by:
isRootin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getChildren
public List<T> getChildren()
- Specified by:
getChildrenin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getChildCount
public int getChildCount()
- Specified by:
getChildCountin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
isLeaf
public boolean isLeaf()
- Specified by:
isLeafin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
appendChild
public void appendChild(T child)
- Specified by:
appendChildin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
appendChildren
public void appendChildren(List<T> list)
- Specified by:
appendChildrenin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
insertChild
public void insertChild(T child, int index) throws IndexOutOfBoundsException
- Specified by:
insertChildin interfaceGenericTreeNode<T extends GenericTreeNode<T>>- Throws:
IndexOutOfBoundsException
-
removeAllChildren
public void removeAllChildren()
- Specified by:
removeAllChildrenin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
removeChild
public void removeChild(int index) throws IndexOutOfBoundsException- Specified by:
removeChildin interfaceGenericTreeNode<T extends GenericTreeNode<T>>- Throws:
IndexOutOfBoundsException
-
removeChild
public void removeChild(T child) throws IllegalArgumentException
- Specified by:
removeChildin interfaceGenericTreeNode<T extends GenericTreeNode<T>>- Throws:
IllegalArgumentException
-
getChildAt
public T getChildAt(int index) throws IndexOutOfBoundsException
- Specified by:
getChildAtin interfaceGenericTreeNode<T extends GenericTreeNode<T>>- Throws:
IndexOutOfBoundsException
-
getIndex
public int getIndex(T child)
- Specified by:
getIndexin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getPreviousSibling
public T getPreviousSibling()
- Specified by:
getPreviousSiblingin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getNextSibling
public T getNextSibling()
- Specified by:
getNextSiblingin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getDepth
public int getDepth()
- Specified by:
getDepthin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getLeafCount
public int getLeafCount()
- Specified by:
getLeafCountin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
childrenChanged
public void childrenChanged()
This method is called after some child nodes have been added or removed. Subclasses may override this method in order to update their own internal structures.- Specified by:
childrenChangedin interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
-