Package org.openjdk.jmc.common
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 Summary
Modifier and TypeMethodDescriptiongetAttribute
(String key) Gets a named attribute value.String[]
Return an array with the attribute keys for this state.Gets a child of the named type.IState[]
Gets all child nodes.IState[]
getChildren
(String type) Gets all child nodes of a named type.getType()
Get the node type of this state.
-
Method Details
-
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
Gets a named attribute value.- Parameters:
key
- attribute key- Returns:
- attribute value
-
getChild
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
Gets all child nodes of a named type.- Parameters:
type
- node type- Returns:
- an array of child nodes
-