Package cruise.umple.compiler
Class CompositeStateWrapper
java.lang.Object
cruise.umple.compiler.CompositeStateWrapper
public class CompositeStateWrapper
extends java.lang.Object
Container containing multiple concurrent states.
-
Constructor Summary
Constructors Constructor Description CompositeStateWrapper()
-
Method Summary
Modifier and Type Method Description void
addChildState(java.lang.String stateName, CompositeStateWrapper csw)
boolean
addRecursiveChildState(java.lang.String parent, State state)
traverses through the CSW's tree structure and tries to add state.void
addState(State s)
Adds state to composite stateboolean
checkEquality(CompositeStateWrapper csw)
Checks if two CompositeStateWrappers have the same states.boolean
containsState(java.lang.String stateName)
Returns true if CSW contains state (including child states)boolean
containsStateAtTop(java.lang.String givenStateName)
returns true if given state is contained at top nesting level.void
delete()
void
displayPrimacy(boolean dp)
sets displayPrimacy to given boolean for CSW and all child CSWs.java.util.Map<java.lang.String,CompositeStateWrapper>
getChildStates()
java.lang.String
getCompositeName()
Prints the name of the composite state.CompositeStateWrapper
getCopy()
Returns copy of CompositeStateWrapperboolean
getDisplayPrimacy()
TODO implement this system.java.lang.String
getFirstKey()
returns first state key.java.lang.String
getGuardString()
boolean
getHasChildStates()
Map> compositeStateWrapperMap = new HashMap >(); java.util.Map<java.lang.String,java.lang.Boolean>
getIsPrimaryMap()
CompositeStateWrapper
getParentCsw()
java.util.Map<java.lang.String,State>
getStates()
boolean
isTransition(CompositeStateWrapper nextCsw, Transition t)
this method does not distinguish between initial states.boolean
setChildStates(java.util.Map<java.lang.String,CompositeStateWrapper> aChildStates)
boolean
setDisplayPrimacy(boolean aDisplayPrimacy)
boolean
setGuardString(java.lang.String aGuardString)
boolean
setHasChildStates(boolean aHasChildStates)
boolean
setIsPrimaryMap(java.util.Map<java.lang.String,java.lang.Boolean> aIsPrimaryMap)
boolean
setParentCsw(CompositeStateWrapper aParentCsw)
void
setStatePrimacy(java.lang.String sName, boolean primacy)
Sets corresponding boolean value in isPrimaryMap to given booleanboolean
setStates(java.util.Map<java.lang.String,State> aStates)
java.lang.String
toString()
-
Constructor Details
-
CompositeStateWrapper
public CompositeStateWrapper()
-
-
Method Details
-
setStates
-
setHasChildStates
public boolean setHasChildStates(boolean aHasChildStates) -
setDisplayPrimacy
public boolean setDisplayPrimacy(boolean aDisplayPrimacy) -
setParentCsw
-
setChildStates
-
setIsPrimaryMap
public boolean setIsPrimaryMap(java.util.Map<java.lang.String,java.lang.Boolean> aIsPrimaryMap) -
setGuardString
public boolean setGuardString(java.lang.String aGuardString) -
getStates
-
getHasChildStates
public boolean getHasChildStates()Map> compositeStateWrapperMap = new HashMap >(); -
getDisplayPrimacy
public boolean getDisplayPrimacy()TODO implement this system. it will be necessary for creating the state tables. -
getParentCsw
-
getChildStates
-
getIsPrimaryMap
public java.util.Map<java.lang.String,java.lang.Boolean> getIsPrimaryMap() -
getGuardString
public java.lang.String getGuardString() -
delete
public void delete() -
getCopy
Returns copy of CompositeStateWrapper -
containsState
public boolean containsState(java.lang.String stateName)Returns true if CSW contains state (including child states) -
containsStateAtTop
public boolean containsStateAtTop(java.lang.String givenStateName)returns true if given state is contained at top nesting level. -
isTransition
this method does not distinguish between initial states. This means if a transition would lead to an initial state, it must be inferred from outside this method. Currently, the composite state table does this by only using the first valid result that appears. This works because the cswList is naturally ordered by primacy. -
checkEquality
Checks if two CompositeStateWrappers have the same states. -
addState
Adds state to composite state -
addChildState
-
addRecursiveChildState
traverses through the CSW's tree structure and tries to add state. Returns true if successfully added. -
setStatePrimacy
public void setStatePrimacy(java.lang.String sName, boolean primacy)Sets corresponding boolean value in isPrimaryMap to given boolean -
getCompositeName
public java.lang.String getCompositeName()Prints the name of the composite state. name is a conjunction of state names within the composite state. -
displayPrimacy
public void displayPrimacy(boolean dp)sets displayPrimacy to given boolean for CSW and all child CSWs. -
getFirstKey
public java.lang.String getFirstKey()returns first state key. returns null if no keys. -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-