org.vizzini.util.tree
Interface ITreeNodeCollection

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractTreeNodeCollection, ArrayTreeNodeCollection, DefaultTreeNodeCollection

public interface ITreeNodeCollection
extends Cloneable

Defines methods required by a tree node collection.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

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.
 ITreeNode get(int index)
          Return the child at the given index.
 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.
 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.
 

Method Detail

add

boolean add(ITreeNode child)
Add the given child.

Since:
v0.3

add

void add(int index,
         ITreeNode child)
Add the given child at the given index.

Since:
v0.3

addAll

boolean addAll(ITreeNodeCollection collection)
Add the given collection to this.

Since:
v0.3

clear

void clear()
Clear the children.

Since:
v0.3

clone

Object clone()
Return a clone of this instance.

Since:
v0.3

contains

boolean contains(ITreeNode treeNode)
Return true if this contains the given node.

Since:
v0.3

get

ITreeNode get(int index)
Return the child at the given index.

Since:
v0.3

indexOf

int indexOf(ITreeNode treeNode)
Return the index of the given node.

Since:
v0.3

isEmpty

boolean isEmpty()
Return true if this is empty.

Since:
v0.3

iterator

Iterator iterator()
Return an iterator over this collection.

Since:
v0.3

remove

boolean remove(ITreeNode child)
Remove the given child.

Since:
v0.3

remove

ITreeNode remove(int index)
Remove the object at the given index.

Since:
v0.3

set

ITreeNode set(int index,
              ITreeNode child)
Set the given object at the given index.

Parameters:
index - Index.
child - Child to set.
Returns:
the element previously at the specified position.
Since:
v0.3

size

int size()
Return the size of this collection.

Since:
v0.3

toArray

ITreeNode[] toArray()
Return an array representation of this collection.

Since:
v0.3

toArray

ITreeNode[] toArray(ITreeNode[] nodes)
Return an array representation of this collection.

Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02