java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.sequencing.ActivityNode
All Implemented Interfaces:
Serializable

public final class ActivityNode extends Object implements 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 Details

    • ActivityNode

      public ActivityNode()
      Default constructor for the ActivityNode class.

      Initializes an instance of ActivityNode with default values.

  • Method Details

    • fromOrganization

      public static ActivityNode fromOrganization(Scorm2004Organization organization)
      Creates an ActivityNode from a Scorm2004Organization.
      Parameters:
      organization - The organization to create the node from
      Returns:
      The created ActivityNode
    • fromItem

      public static ActivityNode fromItem(Scorm2004Item item, ActivityNode parent)
      Creates an ActivityNode from a Scorm2004Item.
      Parameters:
      item - The item to create the node from
      parent - The parent node
      Returns:
      The created ActivityNode
    • addChild

      public void addChild(ActivityNode child)
      Adds a child node to this node.
      Parameters:
      child - The child node to add
    • getChildren

      public List<ActivityNode> getChildren()
      Gets the children of this node.
      Returns:
      An unmodifiable list of child nodes
    • setChildren

      public void setChildren(List<ActivityNode> children)
      Sets the list of child nodes for this activity node.
      Parameters:
      children - The list of child ActivityNode objects to set.
    • getParent

      public ActivityNode getParent()
      Gets the parent of this node.
      Returns:
      The parent node, or null if this is the root node
    • setParent

      public void setParent(ActivityNode parent)
      Sets the parent activity node for this node.
      Parameters:
      parent - The ActivityNode to set as the parent of this node.
    • getSequencing

      public Sequencing getSequencing()
      Gets the sequencing information for this node.
      Returns:
      The sequencing information
    • setSequencing

      public void setSequencing(Sequencing sequencing)
      Sets the sequencing information for this activity node.
      Parameters:
      sequencing - The Sequencing object to associate with this activity node.
    • getResourceIdentifier

      public String getResourceIdentifier()
      Gets the resource identifier for this node.
      Returns:
      An Optional containing the resource identifier or empty if none is defined
    • setResourceIdentifier

      public void setResourceIdentifier(String resourceIdentifier)
      Sets the resource identifier associated with this activity node.
      Parameters:
      resourceIdentifier - The identifier of the associated resource
    • getIdentifier

      public String getIdentifier()
      Retrieves the identifier of the activity node.
      Returns:
      The identifier of the activity node as a String.
    • setIdentifier

      public void setIdentifier(String identifier)
      Sets the identifier for this activity node.
      Parameters:
      identifier - The unique identifier to set for this activity node.
    • getTitle

      public String getTitle()
      Retrieves the title of the activity node.
      Returns:
      The title of the activity node as a String.
    • setTitle

      public void setTitle(String title)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object