org.jtheque.primary.view.impl.models.tree
Interface TreeElement

All Known Subinterfaces:
Collection, Data, Lending, Person, PrimaryData, PrimarySimpleData, SimpleData
All Known Implementing Classes:
AbstractData, AbstractPrimaryData, Category, CollectionImpl, LendingImpl, PersonImpl, PrimarySimpleDataImpl, RootElement, SimpleDataImpl

public interface TreeElement

Represents an element of a tree model.

Author:
Baptiste Wicht

Method Summary
 void add(TreeElement element)
          Add a tree element to the element.
 void addAll(Iterable<? extends TreeElement> elements)
          Add all the elements to the element.
 void clear()
          Clear the element.
 TreeElement getChild(int index)
          Return the child a the specified index.
 int getChildCount()
          Return the number of childs.
 String getElementName()
          Return the name of the element.
 Icon getIcon()
          Return the icon of the element.
 int indexOf(TreeElement treeElement)
          Return the index of the specified element.
 boolean isCategory()
          Indicate if the element is a category or not.
 boolean isLeaf()
          Indicate if the element is a leaf or not.
 boolean isRoot()
          Indicate if the element is root or not.
 

Method Detail

getElementName

String getElementName()
Return the name of the element.

Returns:
The name

getIcon

Icon getIcon()
Return the icon of the element.

Returns:
The icon

isRoot

boolean isRoot()
Indicate if the element is root or not.

Returns:
true if the element is the root else false.

isCategory

boolean isCategory()
Indicate if the element is a category or not.

Returns:
true if the element is a category else false.

isLeaf

boolean isLeaf()
Indicate if the element is a leaf or not.

Returns:
true if the element is a leaf else false.

getChild

TreeElement getChild(int index)
Return the child a the specified index.

Parameters:
index - The index.
Returns:
The element at the index else null.

getChildCount

int getChildCount()
Return the number of childs.

Returns:
The number of childs.

indexOf

int indexOf(TreeElement treeElement)
Return the index of the specified element.

Parameters:
treeElement - The element to search.
Returns:
the index of the element if found else -1.

add

void add(TreeElement element)
Add a tree element to the element.

Parameters:
element - The element to add.

addAll

void addAll(Iterable<? extends TreeElement> elements)
Add all the elements to the element.

Parameters:
elements - The elements to add.

clear

void clear()
Clear the element.



Copyright © 2010 JTheque. All Rights Reserved.