Class CompositeStateWrapper

java.lang.Object
cruise.umple.compiler.CompositeStateWrapper

public class CompositeStateWrapper
extends java.lang.Object
Container containing multiple concurrent states.
  • Constructor Details

  • Method Details

    • setStates

      public boolean setStates​(java.util.Map<java.lang.String,​State> aStates)
    • setHasChildStates

      public boolean setHasChildStates​(boolean aHasChildStates)
    • setDisplayPrimacy

      public boolean setDisplayPrimacy​(boolean aDisplayPrimacy)
    • setParentCsw

      public boolean setParentCsw​(CompositeStateWrapper aParentCsw)
    • setChildStates

      public boolean setChildStates​(java.util.Map<java.lang.String,​CompositeStateWrapper> aChildStates)
    • setIsPrimaryMap

      public boolean setIsPrimaryMap​(java.util.Map<java.lang.String,​java.lang.Boolean> aIsPrimaryMap)
    • setGuardString

      public boolean setGuardString​(java.lang.String aGuardString)
    • getStates

      public java.util.Map<java.lang.String,​State> 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

      public CompositeStateWrapper getParentCsw()
    • getChildStates

      public java.util.Map<java.lang.String,​CompositeStateWrapper> getChildStates()
    • getIsPrimaryMap

      public java.util.Map<java.lang.String,​java.lang.Boolean> getIsPrimaryMap()
    • getGuardString

      public java.lang.String getGuardString()
    • delete

      public void delete()
    • getCopy

      public CompositeStateWrapper 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

      public boolean isTransition​(CompositeStateWrapper nextCsw, Transition t)
      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

      public boolean checkEquality​(CompositeStateWrapper csw)
      Checks if two CompositeStateWrappers have the same states.
    • addState

      public void addState​(State s)
      Adds state to composite state
    • addChildState

      public void addChildState​(java.lang.String stateName, CompositeStateWrapper csw)
    • addRecursiveChildState

      public boolean addRecursiveChildState​(java.lang.String parent, State state)
      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 class java.lang.Object