Class ActivityNode
java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.sequencing.ActivityNode
- All Implemented Interfaces:
Serializable
Represents a node in the SCORM 2004 Activity Tree.
An ActivityNode can represent either an organization or an item in the SCORM 2004 manifest. It contains references to its parent node and children, as well as the sequencing information associated with the node.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(ActivityNode child) Adds a child node to this node.booleanstatic ActivityNodefromItem(Scorm2004Item item, ActivityNode parent) Creates an ActivityNode from a Scorm2004Item.static ActivityNodefromOrganization(Scorm2004Organization organization) Creates an ActivityNode from a Scorm2004Organization.Gets the children of this node.Retrieves the identifier of the activity node.Gets the parent of this node.Gets the resource identifier for this node.Gets the sequencing information for this node.getTitle()Retrieves the title of the activity node.inthashCode()booleanisLeaf()Determines if this activity node is a leaf node.booleanDetermines if this activity node is visible.voidsetChildren(List<ActivityNode> children) Sets the list of child nodes for this activity node.voidsetIdentifier(String identifier) Sets the identifier for this activity node.voidsetLeaf(boolean leaf) Sets whether this node is a leaf node.voidsetParent(ActivityNode parent) Sets the parent activity node for this node.voidsetResourceIdentifier(String resourceIdentifier) Sets the resource identifier associated with this activity node.voidsetSequencing(Sequencing sequencing) Sets the sequencing information for this activity node.voidSets the title of this activity node.voidsetVisible(boolean visible) Sets the visibility of this activity node.
-
Constructor Details
-
ActivityNode
public ActivityNode()Default constructor for the ActivityNode class.Initializes an instance of ActivityNode with default values.
-
-
Method Details
-
fromOrganization
Creates an ActivityNode from a Scorm2004Organization.- Parameters:
organization- The organization to create the node from- Returns:
- The created ActivityNode
-
fromItem
Creates an ActivityNode from a Scorm2004Item.- Parameters:
item- The item to create the node fromparent- The parent node- Returns:
- The created ActivityNode
-
addChild
Adds a child node to this node.- Parameters:
child- The child node to add
-
getChildren
Gets the children of this node.- Returns:
- An unmodifiable list of child nodes
-
setChildren
Sets the list of child nodes for this activity node.- Parameters:
children- The list of child ActivityNode objects to set.
-
getParent
Gets the parent of this node.- Returns:
- The parent node, or null if this is the root node
-
setParent
Sets the parent activity node for this node.- Parameters:
parent- The ActivityNode to set as the parent of this node.
-
getSequencing
Gets the sequencing information for this node.- Returns:
- The sequencing information
-
setSequencing
Sets the sequencing information for this activity node.- Parameters:
sequencing- The Sequencing object to associate with this activity node.
-
getResourceIdentifier
Gets the resource identifier for this node.- Returns:
- An Optional containing the resource identifier or empty if none is defined
-
setResourceIdentifier
Sets the resource identifier associated with this activity node.- Parameters:
resourceIdentifier- The identifier of the associated resource
-
getIdentifier
Retrieves the identifier of the activity node.- Returns:
- The identifier of the activity node as a String.
-
setIdentifier
Sets the identifier for this activity node.- Parameters:
identifier- The unique identifier to set for this activity node.
-
getTitle
Retrieves the title of the activity node.- Returns:
- The title of the activity node as a String.
-
setTitle
Sets the title of this activity node.- Parameters:
title- The title to set for the activity node.
-
isLeaf
public boolean isLeaf()Determines if this activity node is a leaf node.- Returns:
- true if the node is a leaf node, false otherwise
-
setLeaf
public void setLeaf(boolean leaf) Sets whether this node is a leaf node.- Parameters:
leaf- true if this node is a leaf node, false otherwise
-
isVisible
public boolean isVisible()Determines if this activity node is visible.- Returns:
- true if the activity node is visible, false otherwise
-
setVisible
public void setVisible(boolean visible) Sets the visibility of this activity node.- Parameters:
visible- true to make the activity node visible, false to make it invisible
-
equals
-
hashCode
public int hashCode()
-