org.sakaiproject.tool.assessment.data.model
Interface Tree

All Superinterfaces:
Serializable

public interface Tree
extends Serializable

originally Tree.java

Version:
$Id: Tree.java 632 2005-07-14 21:22:50Z janderse@umich.edu $
Author:
esmiley@stanford.edu

Method Summary
 boolean currentObjectIsParent()
           
 Map getAllObjects()
           
 List getChildList()
           
 List getChildList(Long parentID)
           
 Map getChildren()
           
 Map getChildren(Long parentID)
           
 Long getCurrentId()
           
 String getCurrentLevel()
          Get the current level.
 Object getCurrentObject()
           
 String getCurrentObjectHTMLId()
          This is used to get the String id suitable for use in a javascript tree.
 Collection getCurrentObjectProperties()
          This returns a collection of String properties that can be displayed in a table.
 Object getParent()
           
 List getRootNodeList()
           
 Collection getSortedObjects()
          A collection of objects in proper sorted order for a tree.
 Collection getSortedObjects(Long parentId)
          A collection of objects in proper sorted order for a subpool tree.
 String getSortProperty()
          This gets the property by which siblings will be sorted.
 boolean haveCommonRoot(Long poolIdA, Long poolIdB)
          THis checks to see if given two pools have a common ancestor
 boolean isDescendantOf(Long poolA, Long poolB)
          Is a pool a descendant of the other?
 int poolLevel(Long poolId)
          This returns the level of the pool inside a pool tree, Root being 0.
 void setCurrentId(Long id)
           
 void setPropertyMethods(String[] methods)
          This takes in an array of method names used to get the properties.
 void setSortProperty(String sortBy)
          This sets the property by which siblings will be sorted.
 void sortByProperty(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(Long parentID)
Parameters:
parentID -
Returns:

getChildren

Map getChildren()
Returns:

getChildList

List getChildList(Long parentID)
Parameters:
parentID -
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


isDescendantOf

boolean isDescendantOf(Long poolA,
                       Long poolB)
Is a pool a descendant of the other?


poolLevel

int poolLevel(Long poolId)
This returns the level of the pool inside a pool tree, Root being 0.



Copyright © 2005-2012 Sakai Project. All Rights Reserved.