|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for a tree where nodes can have an arbitrary number of children.
Method Summary | |
Iterator |
children(Position v)
Returns an iterator of the children of a given node. |
Iterator |
elements()
Return an iterator of the elements stored in the tree. |
boolean |
isEmpty()
Returns whether the tree is empty. |
boolean |
isExternal(Position v)
Returns whether a given node is external. |
boolean |
isInternal(Position v)
Returns whether a given node is internal. |
boolean |
isRoot(Position v)
Returns whether a given node is the root of the tree. |
Position |
parent(Position v)
Returns the parent of a given node. |
Iterator |
positions()
Returns an iterator of the nodes stored in the tree. |
Object |
replace(Position v,
Object e)
Replaces the element stored at a given node. |
Position |
root()
Returns the root of the tree. |
int |
size()
Returns the number of nodes in the tree. |
Method Detail |
public int size()
public boolean isEmpty()
public Iterator elements()
public Iterator positions()
public Object replace(Position v, Object e) throws InvalidPositionException
InvalidPositionException
public Position root() throws EmptyTreeException
EmptyTreeException
public Position parent(Position v) throws InvalidPositionException, BoundaryViolationException
InvalidPositionException
BoundaryViolationException
public Iterator children(Position v) throws InvalidPositionException
InvalidPositionException
public boolean isInternal(Position v) throws InvalidPositionException
InvalidPositionException
public boolean isExternal(Position v) throws InvalidPositionException
InvalidPositionException
public boolean isRoot(Position v) throws InvalidPositionException
InvalidPositionException
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |