AnyLogic AnyLogic
Expand
Font size
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

Method Summary

All Methods Instance Methods Abstract Methods Default Methods 
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

Method Detail

name

java.lang.String name()
Returns the name of a statechart state.
Returns:
state name

containsState

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 if this contains simpleState

isSimpleState

default boolean isSimpleState()
Returns true if this state is a simple (not composite) state

getContainerState

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).
Parameters:
state - the state whose immediate container is being looked for
Returns:
the immediate container state of state, or null

getSimpleStatesDeep

@AnyLogicInternalAPI
@AnyLogicInternalCodegenAPI
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();

calculateAllSimpleStatesDeep

@AnyLogicInternalCodegenAPI
default java.util.Collection<T> calculateAllSimpleStatesDeep()

getStatesInside

java.util.Set<T> getStatesInside()
Returns unordered set of all, simple & composite, states inside this state.

calculateStatesInside

@AnyLogicInternalCodegenAPI
default java.util.Set<T> calculateStatesInside()

getFullState

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();

calculateFullState

@AnyLogicInternalCodegenAPI
default java.util.Set<T> calculateFullState()

ordinal

int ordinal()
Returns the ordinal number of this state in the statechart (states are numbered in some deterministic order)
See Also:
Enum.ordinal()

getStatechart

@AnyLogicInternalCodegenAPI
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
Parameters:
agent - statechart owner
Returns:
statechart or null

inState

@AnyLogicInternalAPI
default boolean inState​(Agent agent)
How can we improve this article?