org.sakaiproject.tool.assessment.business.questionpool
Class QuestionPoolTreeImpl

java.lang.Object
  extended by org.sakaiproject.tool.assessment.business.questionpool.QuestionPoolTreeImpl
All Implemented Interfaces:
Serializable, Tree

public class QuestionPoolTreeImpl
extends Object
implements Tree

DOCUMENTATION PENDING

Version:
$Id: QuestionPoolTreeImpl.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
Author:
$author$
See Also:
Serialized Form

Constructor Summary
QuestionPoolTreeImpl()
           
QuestionPoolTreeImpl(QuestionPoolIteratorFacade iter)
          Constucts the representation of the tree of pools.
 
Method Summary
 boolean currentObjectIsParent()
          Determine if the pool has childeren
 Map getAllObjects()
          Get Map of QuestionPoolImpls.
 List getChildList()
          List the child pool id strings
 List getChildList(Long parentId)
          Get a List of pools having parentId as parent
 Map getChildren()
          Get Map of QuestionPoolImpls retricted to childeren of the currently selected pool Id string
 Map getChildren(Long parentId)
          Get Map of QuestionPoolImpls retricted to a given Parent Id string
 Long getCurrentId()
          Obtain the poolId set as the current working poolId-designated node
 String getCurrentLevel()
          Get the current level.
 Object getCurrentObject()
          Get the object we're currently looking at.
 String getCurrentObjectHTMLId()
          Get the HTML id of the current object.
 Collection getCurrentObjectProperties()
          Return in order the current: Pool Name Author Last Modified Total # of Questions Total # of Subpools
 boolean getHasChildList()
           
 boolean getHasNoChildList()
           
 Object getParent()
          Get the parent of the object we're currently looking at.
 List getRootNodeList()
          Get a List of top level pools.
 Collection getSortedObjects()
          Dump the tree into a long collection of objects of the form: Pool 1 Pool 2 Pool 3 Pool 4 Pool 5
 Collection getSortedObjects(Long poolId)
          get sorted objects 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 (pool A) a descendant of the other (Pool B)?
 int poolLevel(Long poolId)
          This returns the level of the pool inside a pool tree, Root being 0.
 void setCurrentId(Long poolId)
          Set the current working poolId String, from which context relative child lists are calculated from the poolId-designated node
 void setCurrentObjectHTMLId(String param)
           
 void setPropertyMethods(String[] methods)
          Set the properties to request.
 void setSortProperty(String newProperty)
          This sets the property by which siblings will be sorted.
 void sortByProperty(String sortProperty, boolean sortAscending)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestionPoolTreeImpl

public QuestionPoolTreeImpl()

QuestionPoolTreeImpl

public QuestionPoolTreeImpl(QuestionPoolIteratorFacade iter)
Constucts the representation of the tree of pools.

Parameters:
iter - QuestionPoolIteratorFacade for the pools in question
Method Detail

getChildList

public List getChildList(Long parentId)
Get a List of pools having parentId as parent

Specified by:
getChildList in interface Tree
Parameters:
parentId - the Id of the parent pool
Returns:
a List with the Ids of all momma's children

getRootNodeList

public List getRootNodeList()
Get a List of top level pools.

Specified by:
getRootNodeList in interface Tree
Returns:
List of top level pool id strings

getCurrentObject

public Object getCurrentObject()
Get the object we're currently looking at.

Specified by:
getCurrentObject in interface Tree
Returns:
Current QuestionPool.

getParent

public Object getParent()
Get the parent of the object we're currently looking at.

Specified by:
getParent in interface Tree
Returns:
The parent pool of the current object, or null if it's a root node.

setCurrentObjectHTMLId

public void setCurrentObjectHTMLId(String param)

getCurrentObjectHTMLId

public String getCurrentObjectHTMLId()
Get the HTML id of the current object.

Specified by:
getCurrentObjectHTMLId in interface Tree
Returns:
An HTML representation of the pool Id.

getCurrentLevel

public String getCurrentLevel()
Get the current level.

Specified by:
getCurrentLevel in interface Tree
Returns:
A String that represents the level we're on (1 is root node, 2 is first level child, etc..

getCurrentObjectProperties

public Collection getCurrentObjectProperties()
Return in order the current:

setPropertyMethods

public void setPropertyMethods(String[] methods)
Set the properties to request. Not needed here.

Specified by:
setPropertyMethods in interface Tree

getAllObjects

public Map getAllObjects()
Get Map of QuestionPoolImpls.

Specified by:
getAllObjects in interface Tree
Returns:
Map of all QuestionPoolImpls

getSortedObjects

public Collection getSortedObjects()
Dump the tree into a long collection of objects of the form:

getSortedObjects

public Collection getSortedObjects(Long poolId)
get sorted objects for a subpool tree

Specified by:
getSortedObjects in interface Tree

getChildren

public Map getChildren(Long parentId)
Get Map of QuestionPoolImpls retricted to a given Parent Id string

Specified by:
getChildren in interface Tree
Parameters:
parentId - parent of all returned children
Returns:
a Map of QuestionPoolImpls that are childen

getChildren

public Map getChildren()
Get Map of QuestionPoolImpls retricted to childeren of the currently selected pool Id string

Specified by:
getChildren in interface Tree
Returns:
a Map of QuestionPoolImpls that are children

getCurrentId

public Long getCurrentId()
Obtain the poolId set as the current working poolId-designated node

Specified by:
getCurrentId in interface Tree
Returns:
the current working poolId String

setCurrentId

public void setCurrentId(Long poolId)
Set the current working poolId String, from which context relative child lists are calculated from the poolId-designated node

Specified by:
setCurrentId in interface Tree
Parameters:
poolId -

currentObjectIsParent

public boolean currentObjectIsParent()
Determine if the pool has childeren

Specified by:
currentObjectIsParent in interface Tree
Returns:
true if it has children

getChildList

public List getChildList()
List the child pool id strings

Specified by:
getChildList in interface Tree
Returns:
a list of children's pool id strings

getHasChildList

public boolean getHasChildList()
Returns:
true if childlist is not empty, false otherwise

getHasNoChildList

public boolean getHasNoChildList()

getSortProperty

public String getSortProperty()
This gets the property by which siblings will be sorted.

Specified by:
getSortProperty in interface Tree
Returns:
A String representation of the sort property.

setSortProperty

public void setSortProperty(String newProperty)
This sets the property by which siblings will be sorted.

Specified by:
setSortProperty in interface Tree

sortByProperty

public void sortByProperty(String sortProperty,
                           boolean sortAscending)
Specified by:
sortByProperty in interface Tree

haveCommonRoot

public boolean haveCommonRoot(Long poolIdA,
                              Long poolIdB)
THis checks to see if given two pools have a common ancestor

Specified by:
haveCommonRoot in interface Tree

isDescendantOf

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

Specified by:
isDescendantOf in interface Tree

poolLevel

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

Specified by:
poolLevel in interface Tree


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