Class ActivityTree
java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.sequencing.ActivityTree
- All Implemented Interfaces:
Serializable
Represents a SCORM 2004 Activity Tree.
An ActivityTree is a hierarchical structure of ActivityNodes that represents the organization of learning activities in a SCORM 2004 content package. It is built from the manifest and provides methods to navigate and manipulate the tree.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ActivityTreebuildFromManifest(Scorm2004Manifest manifest) Builds an ActivityTree from a SCORM 2004 manifest.booleanGets all leaf nodes in the tree.getNodeByIdentifier(String identifier) Gets a node by its identifier.Retrieves the mapping of node identifiers to their corresponding activity nodes.getRoot()Gets the root node of the tree.inthashCode()voidsetNodeMap(Map<String, ActivityNode> nodeMap) Sets the mapping of node identifiers to their corresponding activity nodes.voidsetRoot(ActivityNode root) Sets the root node of the activity tree.
-
Method Details
-
buildFromManifest
Builds an ActivityTree from a SCORM 2004 manifest.- Parameters:
manifest- The manifest to build the tree from- Returns:
- The built ActivityTree, or empty if no default organization is found
-
getNodeByIdentifier
Gets a node by its identifier.- Parameters:
identifier- The identifier of the node to get- Returns:
- An Optional containing the node or empty if not found
-
getLeafNodes
Gets all leaf nodes in the tree.- Returns:
- A list of all leaf nodes
-
getRoot
Gets the root node of the tree.- Returns:
- The root node
-
setRoot
Sets the root node of the activity tree.- Parameters:
root- The new root node to be set for the activity tree
-
getNodeMap
Retrieves the mapping of node identifiers to their corresponding activity nodes.- Returns:
- A map where the keys are node identifiers and the values are ActivityNode objects.
-
setNodeMap
Sets the mapping of node identifiers to their corresponding activity nodes.- Parameters:
nodeMap- The map where the keys are node identifiers (as Strings) and the values are the corresponding ActivityNode objects.
-
equals
-
hashCode
public int hashCode()
-