public class Tree<M extends Mappable> extends Object implements MapModel
Modifier and Type | Method and Description |
---|---|
void |
addChild(Tree<M> child) |
int |
childCount() |
ListIterator<Tree> |
childrenIterator() |
int |
depth()
Returns the depth of the tree.
|
Tree |
getChild(int n) |
Mappable[] |
getItems()
Get the list of items in this model.
|
MapModel[] |
getLeafModels() |
M |
getMapItem() |
Tree |
getParent() |
Mappable[] |
getTreeItems() |
boolean |
hasChildren() |
boolean |
isLeaf() |
List<Tree> |
peekAtChildren() |
void |
print() |
void |
setOrder(int order) |
void |
setParent(Tree parent) |
double |
sum()
Recursively sets the size (weight) of this Tree to the
sum of the sizes of its children.
|
void |
traversePost(Walker<Tree<M>> walker)
Do a postorder traversal of this Tree
|
void |
traversePre(Walker<Tree<M>> walker)
Do a preorder traversal of this Tree
|
public Tree(M mapItem)
public ListIterator<Tree> childrenIterator()
public void setOrder(int order)
public MapModel[] getLeafModels()
public int depth()
public Mappable[] getTreeItems()
public double sum()
public Mappable[] getItems()
MapModel
public M getMapItem()
public void setParent(Tree parent)
public Tree getParent()
public int childCount()
public Tree getChild(int n)
public boolean hasChildren()
public boolean isLeaf()
public void print()
Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.