Package com.anylogic.engine
- Type Parameters:
T
- the self-type of units enum
public interface IStatechartState<A extends Agent,T extends java.lang.Enum<T> & IStatechartState<A,T>>
Base interface for all statechart state enumerations
- Author:
- AnyLogic North America, LLC https://anylogic.com
default java.util.Collection<T> |
calculateAllSimpleStatesDeep() |
|
default java.util.Set<T> |
calculateFullState() |
|
default java.util.Set<T> |
calculateStatesInside() |
|
default boolean |
containsState(T simpleState) |
Checks if this state of a statechart is composite and it contains another
(deep contents - inside contained composite states - are also checked).
|
default T |
getContainerState() |
Returns the immediate container state of this state or
null if this state
is at the topmost level (has no container state). |
java.util.Set<T> |
getFullState() |
Returns the unordered set containing this state and all (if any) composite states containing this state.
Internal technical info for code generation: Typical implementation: return fullState; where the field
is initialized lazily: fullState = calculateFullState(); |
java.util.Collection<T> |
getSimpleStatesDeep() |
Returns collection of all simple states inside this state.
Typical implementation: return simpleStates; where the field
is initialized in constructor: simpleStates = calculateAllSimpleStatesDeep(); |
Statechart<T> |
getStatechart(A agent) |
Returns statechart from the given agent which owns this state.
Returns null if the agent has no statechart with this state |
java.util.Set<T> |
getStatesInside() |
Returns unordered set of all, simple & composite, states inside this state.
|
default boolean |
inState(Agent agent) |
|
default boolean |
isSimpleState() |
Returns
true if this state is a simple (not composite) state |
java.lang.String |
name() |
Returns the name of a statechart state.
|
int |
ordinal() |
Returns the ordinal number of this state in the statechart (states are numbered in some deterministic order)
|
Modifier and Type | Method | Description |
---|
java.lang.String name()
Returns the name of a statechart state.
- Returns:
- state name
default boolean containsState(T simpleState)
Checks if this state of a statechart is composite and it contains another
(deep contents - inside contained composite states - are also checked).
- Parameters:
simpleState
- the (possibly) simple state- Returns:
true
ifthis
containssimpleState
default boolean isSimpleState()
Returns
true
if this state is a simple (not composite) statedefault T getContainerState()
Returns the immediate container state of this state or
null
if this state
is at the topmost level (has no container state).- Parameters:
state
- the state whose immediate container is being looked for- Returns:
- the immediate container state of state, or
null
@AnyLogicInternalAPI @AnyLogicInternalCodegenAPI java.util.Collection<T> getSimpleStatesDeep()
Returns collection of all simple states inside this state.
Typical implementation:
Typical implementation:
return simpleStates;
where the field
is initialized in constructor: simpleStates = calculateAllSimpleStatesDeep();
@AnyLogicInternalCodegenAPI default java.util.Collection<T> calculateAllSimpleStatesDeep()
java.util.Set<T> getStatesInside()
Returns unordered set of all, simple & composite, states inside this state.
@AnyLogicInternalCodegenAPI default java.util.Set<T> calculateStatesInside()
java.util.Set<T> getFullState()
Returns the unordered set containing this state and all (if any) composite states containing this state.
Internal technical info for code generation: Typical implementation:
Internal technical info for code generation: Typical implementation:
return fullState;
where the field
is initialized lazily: fullState = calculateFullState();
@AnyLogicInternalCodegenAPI default java.util.Set<T> calculateFullState()
int ordinal()
Returns the ordinal number of this state in the statechart (states are numbered in some deterministic order)
- See Also:
Enum.ordinal()
@AnyLogicInternalCodegenAPI Statechart<T> getStatechart(A agent)
Returns statechart from the given agent which owns this state.
Returns
Returns
null
if the agent has no statechart with this state- Parameters:
agent
- statechart owner- Returns:
- statechart or
null
@AnyLogicInternalAPI default boolean inState(Agent agent)
-
How can we improve this article?
-