|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used to manipulate tree-like data structures. The interface provides following three abilities:
Method Summary | |
void |
add(Item to,
Item item)
Adds the item into the tree as a child of the parent item. |
void |
addTreeListener(TreeListener l)
Adds the specified tree listener to receive the tree events. |
Item |
getChildAt(Item item,
int index)
Returns a child item for the given parent item at the specified index. |
int |
getChildIndex(Item item)
Searches for the first occurence of the given item in the parent items vector, testing for equality using the equals method and returns the child index. |
int |
getChildrenCount(Item item)
Returns a number of child items for the given parent item. |
int |
getItemsCount()
Gets the total items number that are contained by the tree. |
Item |
getParent(Item item)
Returns a parent for the given item. |
Item |
getRoot()
Gets the root item of the tree model. |
boolean |
hasChildren(Item item)
Tests if the item has one or more child items. |
void |
insert(Item to,
Item item,
int index)
Inserts the specified item into the tree as a child of the parent item, at the specified index. |
void |
remove(Item item)
Removes the specified item from the tree. |
void |
removeTreeListener(TreeListener l)
Removes the specified tree listener so that it no longer receives tree events from this tree model. |
void |
set(Item item,
java.lang.Object value)
Sets the specified value for the given tree item. |
Method Detail |
public Item getRoot()
public int getItemsCount()
public Item getParent(Item item)
item
- the specified item to define it parent.public Item getChildAt(Item item, int index)
item
- the item that is used as a parent to get a child item by the index.index
- the index into this parent child items vector.public int getChildIndex(Item item)
equals
method and returns the child index.item
- the specified item to define it index.-1
if the item is not member of the model.public int getChildrenCount(Item item)
item
- the parent item to define a number of child items.public boolean hasChildren(Item item)
item
- the item to test.true
if the item has one or more child items; false
otherwisepublic void add(Item to, Item item)
to
- the parent item.item
- the child item that has to be added.public void insert(Item to, Item item, int index)
to
- the specified parent item.item
- the specified child item that has to be added.index
- the specified index where the child has to be inserted.public void set(Item item, java.lang.Object value)
item
- the item.o
- the specified value.public void remove(Item item)
item
- the item that has to be removed.public void addTreeListener(TreeListener l)
l
- the tree listener.public void removeTreeListener(TreeListener l)
l
- the tree listener.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |