|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.util.tree.ArrayTreeNodeCollection
public class ArrayTreeNodeCollection
Provides an implementation of a tree node collection which uses an array.
Constructor Summary | |
---|---|
ArrayTreeNodeCollection()
Construct this object. |
|
ArrayTreeNodeCollection(int capacity)
Construct this object with the given parameter. |
Method Summary | |
---|---|
void |
add(int index,
ITreeNode child)
Add the given child at the given index. |
boolean |
add(ITreeNode child)
Add the given child. |
boolean |
addAll(ITreeNodeCollection collection)
Add the given collection to this. |
void |
clear()
Clear the children. |
Object |
clone()
Return a clone of this instance. |
boolean |
contains(ITreeNode treeNode)
Return true if this contains the given node. |
protected ITreeNode[] |
deepClone(ITreeNode[] nodes)
Create a new List which contains clones of the items in the
given list. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
ITreeNode |
get(int index)
Return the child at the given index. |
int |
getCapacity()
|
int |
getIndex()
|
ITreeNode[] |
getNodes()
|
int |
hashCode()
Returns a hash code value for the object. |
int |
indexOf(ITreeNode treeNode)
Return the index of the given node. |
boolean |
isEmpty()
Return true if this is empty. |
Iterator |
iterator()
Return an iterator over this collection. |
ITreeNode |
remove(int index)
Remove the object at the given index. |
boolean |
remove(ITreeNode child)
Remove the given child. |
ITreeNode |
set(int index,
ITreeNode child)
Set the given object at the given index. |
void |
setCapacity(int capacity)
Set capacity. |
void |
setIndex(int index)
|
void |
setNodes(ITreeNode[] nodes)
|
int |
size()
Return the size of this collection. |
ITreeNode[] |
toArray()
Return an array representation of this collection. |
ITreeNode[] |
toArray(ITreeNode[] nodes)
Return an array representation of this collection. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayTreeNodeCollection()
public ArrayTreeNodeCollection(int capacity)
capacity
- Capacity.Method Detail |
---|
public boolean add(ITreeNode child)
add
in interface ITreeNodeCollection
public void add(int index, ITreeNode child)
add
in interface ITreeNodeCollection
public boolean addAll(ITreeNodeCollection collection)
addAll
in interface ITreeNodeCollection
public void clear()
clear
in interface ITreeNodeCollection
public Object clone()
clone
in interface ITreeNodeCollection
clone
in class Object
public boolean contains(ITreeNode treeNode)
contains
in interface ITreeNodeCollection
public boolean equals(Object object)
equals
in class Object
object
- The object to compare.public ITreeNode get(int index)
get
in interface ITreeNodeCollection
public int getCapacity()
public int getIndex()
public ITreeNode[] getNodes()
public int hashCode()
hashCode
in class Object
public int indexOf(ITreeNode treeNode)
indexOf
in interface ITreeNodeCollection
public boolean isEmpty()
isEmpty
in interface ITreeNodeCollection
public Iterator iterator()
iterator
in interface ITreeNodeCollection
public boolean remove(ITreeNode child)
remove
in interface ITreeNodeCollection
public ITreeNode remove(int index)
remove
in interface ITreeNodeCollection
public ITreeNode set(int index, ITreeNode child)
set
in interface ITreeNodeCollection
index
- Index.child
- Child to set.
public void setCapacity(int capacity)
public void setIndex(int index)
index
- the index to setpublic void setNodes(ITreeNode[] nodes)
nodes
- the nodes to setpublic int size()
size
in interface ITreeNodeCollection
public ITreeNode[] toArray()
toArray
in interface ITreeNodeCollection
public ITreeNode[] toArray(ITreeNode[] nodes)
toArray
in interface ITreeNodeCollection
protected ITreeNode[] deepClone(ITreeNode[] nodes)
List
which contains clones of the items in the
given list.
nodes
- Array of nodes to clone.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |