|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.Tree<E>
public class Tree<E>
Nested Class Summary | |
---|---|
private class |
Tree.ElementIterator
An iterator that return elements for each node. |
static class |
Tree.Entry<E>
Represents an entry for a node in the tree. |
private class |
Tree.EntryIterator
An iterator that return entries for each node. |
Field Summary | |
---|---|
private Map<E,Tree.Entry<E>> |
entries
|
private E |
root
|
Constructor Summary | |
---|---|
Tree(E root)
Create a new tree with the with the default initial capacity (16). |
|
Tree(E root,
int initialCapacity)
Create a new tree with the with the specified initial capacity. |
Method Summary | ||
---|---|---|
boolean |
add(E o)
Not supported. |
|
boolean |
addAll(Collection<? extends E> c)
Not supported. |
|
private void |
addEntry(Tree.Entry<E> entry)
|
|
void |
clear()
Clear all elements except the root element. |
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
Iterator<Tree.Entry<E>> |
entryIterator()
Create an iterator for the tree that returns entry object. |
|
Iterator<Tree.Entry<E>> |
entryIterator(E node)
Create an iterator for the tree starting at a specific node. |
|
boolean |
equals(Object o)
Equality only tests if the object is the same instance of this tree. |
|
Tree.Entry<E> |
getEntry(E node)
Get the entry for an arbitrary node. |
|
Tree.Entry<E> |
getRootEntry()
Get the entry for the root node. |
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
boolean |
remove(Object o)
Not supported. |
|
boolean |
removeAll(Collection<?> c)
Not supported. |
|
boolean |
retainAll(Collection<?> c)
Not supported. |
|
int |
size()
|
|
Object[] |
toArray()
Not supported. |
|
|
toArray(T[] a)
Not supported. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
hashCode |
Field Detail |
---|
private final E root
private final Map<E,Tree.Entry<E>> entries
Constructor Detail |
---|
public Tree(E root)
root
- The root node element of the treepublic Tree(E root, int initialCapacity)
root
- The root node element of the treeinitialCapacity
- The initial capacityMethod Detail |
---|
public boolean add(E o)
add
in interface Collection<E>
UnsupportedOperationException
- AlwaysTree.Entry.addChild(Object)
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic void clear()
clear
in interface Collection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in class Object
public boolean isEmpty()
isEmpty
in interface Collection<E>
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic int size()
size
in interface Collection<E>
public Object[] toArray()
toArray
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
UnsupportedOperationException
- Alwayspublic Tree.Entry<E> getRootEntry()
Entry
object for the root node.public Tree.Entry<E> getEntry(E node)
node
- The node to get the entry for.
Entry
object or null if the node isn't foundpublic Iterator<Tree.Entry<E>> entryIterator()
Iterator
objectiterator()
public Iterator<Tree.Entry<E>> entryIterator(E node)
node
- The node to start at
Iterator
objectiterator()
private void addEntry(Tree.Entry<E> entry)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |