Interface IWithGroupOrUnitNode

    • Method Detail

      • addUnitNode

        UnitNode addUnitNode​(String id)
        Adds a UnitNode to this object.
        Parameters:
        id - the ID of the new unit.
        Returns:
        the added unit node.
      • add

        GroupNode add​(GroupNode node)
        Adds a GroupNode to this object. If the group ID is null, it is automatically set to a UUID.
        Parameters:
        node - the group node to add.
        Returns:
        the added group node.
        See Also:
        addGroupNode(String)
      • addGroupNode

        GroupNode addGroupNode​(String id)
        Adds a GroupNode to this object.
        Parameters:
        id - the ID of the group (can be null). If the ID is null it is automatically set to a UUID.
        Returns:
        the added group node.
      • getUnitNodes

        List<UnitNode> getUnitNodes()
        Gets all the UnitNode elements of this object. All units at any level in this object are returned.
        Returns:
        all the unit nodes for the object. The list will be empty (but never null), if no unit nodes were found.
      • getUnitNode

        UnitNode getUnitNode​(String id)
        Gets the UnitNode for a given unit id. The unit can be at any level in this object.
        Parameters:
        id - the id to look for.
        Returns:
        the unit node for the given id, or null if none is found.
      • getGroupNode

        GroupNode getGroupNode​(String id)
        Gets a GroupNode for a given id. The group can be at any level in this object.
        Parameters:
        id - the id to look for.
        Returns:
        the group node for the given id, or null if none is found.
      • createGroupOrUnitIterator

        Iterator<IGroupOrUnitNode> createGroupOrUnitIterator()
        Creates an iterator for the group nodes and unit nodes in this object.
        Returns:
        a new iterator for the nodes in this object.