Interface Tree
-
- All Superinterfaces:
Serializable
public interface Tree extends Serializable
originally Tree.java- Version:
- $Id$
- Author:
- esmiley@stanford.edu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancurrentObjectIsParent()MapgetAllObjects()ListgetChildList()ListgetChildList(Long parentID)MapgetChildren()MapgetChildren(Long parentID)LonggetCurrentId()StringgetCurrentLevel()Get the current level.ObjectgetCurrentObject()StringgetCurrentObjectHTMLId()This is used to get the String id suitable for use in a javascript tree.CollectiongetCurrentObjectProperties()This returns a collection of String properties that can be displayed in a table.ObjectgetParent()ListgetRootNodeList()CollectiongetSortedObjects()A collection of objects in proper sorted order for a tree.CollectiongetSortedObjects(Long parentId)A collection of objects in proper sorted order for a subpool tree.StringgetSortProperty()This gets the property by which siblings will be sorted.booleanhaveCommonRoot(Long poolIdA, Long poolIdB)THis checks to see if given two pools have a common ancestorbooleanisDescendantOf(Long poolA, Long poolB)Is a pool a descendant of the other?intpoolLevel(Long poolId)This returns the level of the pool inside a pool tree, Root being 0.voidsetCurrentId(Long id)voidsetPropertyMethods(String[] methods)This takes in an array of method names used to get the properties.voidsetSortProperty(String sortBy)This sets the property by which siblings will be sorted.voidsortByProperty(String sortProperty, boolean sortAscending)This sorts the tree by the property .
-
-
-
Method Detail
-
getCurrentId
Long getCurrentId()
- Returns:
-
setCurrentId
void setCurrentId(Long id)
- Parameters:
id-
-
currentObjectIsParent
boolean currentObjectIsParent()
- Returns:
-
getCurrentObject
Object getCurrentObject()
- Returns:
-
getParent
Object getParent()
- Returns:
-
getCurrentObjectHTMLId
String getCurrentObjectHTMLId()
This is used to get the String id suitable for use in a javascript tree.
-
getCurrentLevel
String getCurrentLevel()
Get the current level.- Returns:
- A String that represents the level we're on (1 is root node, 2 is first level child, etc..
-
getCurrentObjectProperties
Collection getCurrentObjectProperties()
This returns a collection of String properties that can be displayed in a table. If (currentObjectId == null), returns the list of column headers.
-
setPropertyMethods
void setPropertyMethods(String[] methods)
This takes in an array of method names used to get the properties. These are used to return a collection of String properties that can then be displayed in a javascript tree.This does not have to be implemented -- it will be a dummy method for most trees. i.e.
String[] methods = new String[3]; methods[0] = "getName"; methods[1] = "getNumberOfSubpools"; methods[2] = "getDescription";
Which might produce:
{ "Biology 101", "3", "Basic Biology Questions" }
when getCurrentObjectProperties() is called.
-
getAllObjects
Map getAllObjects()
- Returns:
-
getSortedObjects
Collection getSortedObjects()
A collection of objects in proper sorted order for a tree.
-
getSortedObjects
Collection getSortedObjects(Long parentId)
A collection of objects in proper sorted order for a subpool tree.
-
getChildren
Map getChildren()
- Returns:
-
getChildList
List getChildList()
- Returns:
-
getRootNodeList
List getRootNodeList()
- Returns:
-
getSortProperty
String getSortProperty()
This gets the property by which siblings will be sorted.
-
setSortProperty
void setSortProperty(String sortBy)
This sets the property by which siblings will be sorted.
-
sortByProperty
void sortByProperty(String sortProperty, boolean sortAscending)
This sorts the tree by the property .
-
haveCommonRoot
boolean haveCommonRoot(Long poolIdA, Long poolIdB)
THis checks to see if given two pools have a common ancestor
-
poolLevel
int poolLevel(Long poolId)
This returns the level of the pool inside a pool tree, Root being 0.
-
-