org.exoplatform.services.common.util
Class Tree<E>

java.lang.Object
  extended by org.exoplatform.services.common.util.Tree<E>

public class Tree<E>
extends java.lang.Object

Author : Nhu Dinh Thuan nhudinhthuan@yahoo.com Sep 19, 2006


Field Summary
protected  Tree<E> firstChild
           
protected  Tree<E> nextSibling
           
protected  Tree<E> parent
           
protected  int size
           
protected  E value
           
 
Constructor Summary
Tree(E value)
           
Tree(E value, Tree<E> parent)
           
 
Method Summary
 void addChild(Tree<E> node)
           
 Tree<E> getChild(int idx)
           
 Tree<E>[] getChildren()
           
protected  Tree<E> getNextSibling()
           
<T extends Tree>
T
getParent()
           
 int getSize()
           
 E getValue()
           
 void insertChild(int idx, Tree<E> node)
           
 Iterator<E> iteratorChildren()
           
 Tree<E> removeChild(int idx)
           
 void setValue(E value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected E value

parent

protected transient Tree<E> parent

firstChild

protected transient Tree<E> firstChild

size

protected transient int size

nextSibling

protected transient Tree<E> nextSibling
Constructor Detail

Tree

public Tree(E value)

Tree

public Tree(E value,
            Tree<E> parent)
Method Detail

addChild

public void addChild(Tree<E> node)

insertChild

public void insertChild(int idx,
                        Tree<E> node)

iteratorChildren

public Iterator<E> iteratorChildren()

getChild

public Tree<E> getChild(int idx)

removeChild

public Tree<E> removeChild(int idx)

getChildren

public Tree<E>[] getChildren()

getValue

public E getValue()

setValue

public void setValue(E value)

getNextSibling

protected Tree<E> getNextSibling()

getSize

public int getSize()

getParent

public <T extends Tree> T getParent()


Copyright © 2011 eXo Platform SAS. All Rights Reserved.