Interface IState

  • All Known Implementing Classes:
    StatefulState

    public interface IState
    A state container which can be read from. It is an hierarchical structure that can contain named child states. Actual data values are stored in named attributes for each state node.

    This interface is a companion to IWritableState which handles writing of state information.

    • Method Detail

      • getType

        String getType()
        Get the node type of this state.
        Returns:
        node type
      • getAttributeKeys

        String[] getAttributeKeys()
        Return an array with the attribute keys for this state.
        Returns:
        attribute keys
      • getAttribute

        String getAttribute​(String key)
        Gets a named attribute value.
        Parameters:
        key - attribute key
        Returns:
        attribute value
      • getChild

        IState getChild​(String type)
        Gets a child of the named type. If there are several child nodes of the same type then any of them may be returned.
        Parameters:
        type - node type
        Returns:
        child node or null if no such child exists
      • getChildren

        IState[] getChildren()
        Gets all child nodes.
        Returns:
        an array of child nodes
      • getChildren

        IState[] getChildren​(String type)
        Gets all child nodes of a named type.
        Parameters:
        type - node type
        Returns:
        an array of child nodes