org.weblab_project.core.util
Class ComposedUnitUtil

java.lang.Object
  extended by org.weblab_project.core.util.ComposedUnitUtil

public class ComposedUnitUtil
extends java.lang.Object

A class providing useful method for crawling a ComposedUnit.

Author:
EADS WebLab Team

Method Summary
static
<T extends org.weblab_project.core.model.MediaUnit>
java.util.List<T>
getSelectedSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu, java.lang.Class<T> mediaUnitClass)
          The same as ComposedUnitUtil.getSubMediaUnits(ComposedUnit, boolean), but with a filter on the MediaUnit class to be retrieved by the List.
static java.util.List<org.weblab_project.core.model.MediaUnit> getSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu)
          Same as ComposedUnitUtil.getSubMediaUnits(cu, false)
static java.util.List<org.weblab_project.core.model.MediaUnit> getSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu, boolean otherComposedIncluded)
          Crawl the MediaUnit tree to get all inner MediaUnits that compose this ComposedUnit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSubMediaUnits

public static java.util.List<org.weblab_project.core.model.MediaUnit> getSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu)
Same as ComposedUnitUtil.getSubMediaUnits(cu, false)

Parameters:
cu - The ComposedUnit to retrieve children
Returns:
The subMediaUnit List without ComposedUnit
See Also:
getSubMediaUnits(ComposedUnit, boolean)

getSubMediaUnits

public static java.util.List<org.weblab_project.core.model.MediaUnit> getSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu,
                                                                                       boolean otherComposedIncluded)
Crawl the MediaUnit tree to get all inner MediaUnits that compose this ComposedUnit. It will seek for ComposedUnits and theirs children and then children of the children... until it reaches all leafs.
The given MediaUnit will NOT be added to the result List.

Parameters:
cu - The ComposedUnit to retrieve children
otherComposedIncluded - Whether or not to included contained ComposedUnits in the returned List. Use false to retrieve only leaf children.
Returns:
The subMediaUnit List

getSelectedSubMediaUnits

public static <T extends org.weblab_project.core.model.MediaUnit> java.util.List<T> getSelectedSubMediaUnits(org.weblab_project.core.model.ComposedUnit cu,
                                                                                                             java.lang.Class<T> mediaUnitClass)
The same as ComposedUnitUtil.getSubMediaUnits(ComposedUnit, boolean), but with a filter on the MediaUnit class to be retrieved by the List. I.e. the only added MediaUnit are those that are instances of mediaUnitClass.

Type Parameters:
T - Subclass of MediaUnit to be retrieved
Parameters:
cu - The ComposedUnit to retrieve children
mediaUnitClass - The Class of the only children you need in result List
Returns:
The subMediaUnit List
See Also:
getSubMediaUnits(ComposedUnit, boolean)


Copyright © 2004-2009. All Rights Reserved.