Constructor and Description |
---|
State()
Initializes a new instance of the
State class. |
State(String name)
Initializes a new instance of the
State class with the specified [name]. |
State(String name,
Object value)
Initializes a new instance of the
State class with the specified [name] and [value]. |
Modifier and Type | Method and Description |
---|---|
State |
copy()
Copies this instance.
|
CustomPropertyCollection |
getCustomProperties()
Gets custom properties associated with this instance.
|
String |
getDescription()
Gets an optional description for the state.
|
int |
getIndex()
Gets the index of the state in a variable's
Variable.getStates() collection. |
String |
getName()
Gets the name of the state.
|
StateCollection |
getStates()
Gets the
StateCollection the state belongs to, if any. |
Object |
getValue()
Gets an optional value for a state, such as an interval for discretized variables.
|
Variable |
getVariable()
Gets the
Variable the state belongs to, if any. |
void |
setDescription(String value)
Sets an optional description for the state.
|
void |
setName(String value)
Sets the name of the state.
|
void |
setValue(Object value)
Sets an optional value for a state, such as an interval for discretized variables.
|
String |
toString()
Returns the name of the state, or an empty string if the name is null.
|
public State()
State
class.public State(String name)
State
class with the specified [name].name
- The name for the state. Can be null.public State(String name, Object value)
State
class with the specified [name] and [value].name
- The name for the state. Can be null.value
- Optional value for the state. When the state is added to a variable, this value must be compatible with the StateValueType
set on the variable.public CustomPropertyCollection getCustomProperties()
public String getDescription()
public void setDescription(String value)
public int getIndex()
Variable.getStates()
collection. Equals -1 if the State
does not belong to a variable.public String getName()
public void setName(String value)
public StateCollection getStates()
StateCollection
the state belongs to, if any.StateCollection
that this instance belongs to. Can be null.public Object getValue()
State
is added to a Variable
this value must be compatible with the StateValueType
set on the variable.public void setValue(Object value)
State
is added to a Variable
this value must be compatible with the StateValueType
set on the variable.public Variable getVariable()
Variable
the state belongs to, if any.
If this instance is a child of another state, the state hierarchy is traversed to reach the variable of the root state, if any.Variable
that this instance belongs to. Can be null.Copyright © 2021. All rights reserved.