org.eclipse.emf.henshin.statespace.impl
Class StateSpaceImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.MinimalEObjectImpl
              extended by org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
                  extended by org.eclipse.emf.henshin.statespace.impl.StorageImpl
                      extended by org.eclipse.emf.henshin.statespace.impl.StateSpaceImpl
All Implemented Interfaces:
Notifier, EObject, EStructuralFeature.Internal.DynamicValueHolder, InternalEObject, StateSpace, Storage

public class StateSpaceImpl
extends StorageImpl
implements StateSpace

Default implementation of the StateSpace interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
MinimalEObjectImpl.Container.Dynamic
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl
MinimalEObjectImpl.Container
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderBaseImpl, BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
InternalEObject.EStore
 
Field Summary
protected static int[] ALL_PARAMETER_KEYS_EDEFAULT
          The default value of the 'All Parameter Keys' attribute.
protected  EqualityHelper equalityHelper
          The cached value of the 'Equality Helper' containment reference.
protected  EList<State> initialStates
          The cached value of the 'Initial States' reference list.
protected static boolean LAYOUT_HIDE_INDIZES_EDEFAULT
          The default value of the 'Layout Hide Indizes' attribute.
protected static boolean LAYOUT_HIDE_LABELS_EDEFAULT
          The default value of the 'Layout Hide Labels' attribute.
protected static int LAYOUT_STATE_REPULSION_EDEFAULT
          The default value of the 'Layout State Repulsion' attribute.
protected static int LAYOUT_TRANSITION_ATTRACTION_EDEFAULT
          The default value of the 'Layout Transition Attraction' attribute.
protected static int LAYOUT_ZOOM_LEVEL_EDEFAULT
          The default value of the 'Layout Zoom Level' attribute.
protected static int MAX_STATE_DISTANCE_EDEFAULT
          The default value of the 'Max State Distance' attribute.
protected  Set<State> openStates
          Set of open states.
protected  EMap<String,String> properties
          The cached value of the 'Properties' map.
protected  EList<Rule> rules
          The cached value of the 'Rules' reference list.
protected static int STATE_COUNT_EDEFAULT
          The default value of the 'State Count' attribute.
protected  EList<State> states
          The cached value of the 'States' containment reference list.
protected static int TRANSITION_COUNT_EDEFAULT
          The default value of the 'Transition Count' attribute.
protected  int transitionCount
          The cached value of the 'Transition Count' attribute.
 
Fields inherited from class org.eclipse.emf.henshin.statespace.impl.StorageImpl
data, DATA_EDEFAULT, EMPTY_DATA
 
Fields inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
eContainer
 
Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET
 
Fields inherited from interface org.eclipse.emf.henshin.statespace.StateSpace
PROPERTY_CHECK_LINK_ORDER, PROPERTY_CLOCK_DECLARATIONS, PROPERTY_COLLECT_MISSING_ROOTS, PROPERTY_CONSTANTS, PROPERTY_GOAL_PROPERTY, PROPERTY_IDENTITY_TYPES, PROPERTY_IGNORE_DUPLICATE_TRANSITIONS, PROPERTY_IGNORED_ATTRIBUTES, PROPERTY_USE_CLOCKS
 
Fields inherited from interface org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder
NIL
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
protected StateSpaceImpl()
          Default constructor.
  StateSpaceImpl(Module module)
          Constructor.
 
Method Summary
 NotificationChain basicSetEqualityHelper(EqualityHelper newEqualityHelper, NotificationChain msgs)
           
 Object eGet(int featureID, boolean resolve, boolean coreType)
           
 NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
           
 NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, Object newValue)
           
protected  EClass eStaticClass()
           
 void eUnset(int featureID)
           
 int[] getAllParameterKeys()
          Get all object keys used as parameters in transitions in this state space.
 EqualityHelper getEqualityHelper()
           
 EList<State> getInitialStates()
           
 int getLayoutStateRepulsion()
          Get the state repulsion to be used when layouting this state space.
 int getLayoutTransitionAttraction()
          Get the transition attraction to be used when layouting this state space.
 int getLayoutZoomLevel()
          Get the zoom level to be used when this state space is displayed.
 int getMaxStateDistance()
          Get the maximum distance of states from the initial states.
 Set<State> getOpenStates()
          Get the set of open states in this state space.
 EMap<String,String> getProperties()
           
 EList<Rule> getRules()
           
 int getStateCount()
          Get the number of states in this state space.
 EList<State> getStates()
          Get the list of states in this state space.
 int getTransitionCount()
           
 int incTransitionCount()
           
 boolean isLayoutHideIndizes()
          Returns the value of the 'Layout Hide Indizes' attribute.
 boolean isLayoutHideLabels()
          Check whether labels should be hidden.
 boolean removeState(State state)
          Remove a state and detach its transitions from the other states.
 void setEqualityHelper(EqualityHelper newEqualityHelper)
          Set the equality helper for this state space.
 void setLayoutHideIndizes(boolean hideIndizes)
          Sets the value of the 'Layout Hide Indizes' attribute.
 void setLayoutHideLabels(boolean hideLabels)
          Set the hide-labels flag.
 void setLayoutStateRepulsion(int repulsion)
          Set the state repulsion to be used when layouting this state space.
 void setLayoutTransitionAttraction(int attraction)
          Set the transition attraction to be used when layouting this state space.
 void setLayoutZoomLevel(int zoomLevel)
          Set the zoom level for this state space.
 void setMaxStateDistance(int maxStateDistance)
          Set the maximum distance of states from the initial states.
 void setTransitionCount(int newTransitionCount)
           
 String toString()
           
 void updateEqualityHelper()
           
 
Methods inherited from class org.eclipse.emf.henshin.statespace.impl.StorageImpl
getData, getData, getData, setData, setData, setData, setData
 
Methods inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container
eBasicSetContainer, eInternalContainer
 
Methods inherited from class org.eclipse.emf.ecore.impl.MinimalEObjectImpl
dynamicGet, dynamicSet, dynamicUnset, eAdapters, eBasicAdapterArray, eBasicAdapters, eBasicHasAdapters, eBasicProperties, eBasicSetAdapterArray, eBasicSetContainer, eBasicSetContainerFeatureID, eBasicSetSettings, eBasicSettings, eClass, eContainerFeatureID, eContents, eCrossReferences, eDeliver, eDirectResource, eDynamicClass, eHasSettings, eIsProxy, eProperties, eProxyURI, eSetClass, eSetDeliver, eSetDirectResource, eSetProxyURI, eSettings
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDynamicBasicRemoveFromContainer, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseRemove, eInvocationDelegate, eInvoke, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eSettingDelegate, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.henshin.statespace.Storage
getData, getData, getData, setData, setData, setData, setData
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

rules

protected EList<Rule> rules
The cached value of the 'Rules' reference list.

See Also:
getRules()

states

protected EList<State> states
The cached value of the 'States' containment reference list.

See Also:
getStates()

initialStates

protected EList<State> initialStates
The cached value of the 'Initial States' reference list.

See Also:
getInitialStates()

openStates

protected Set<State> openStates
Set of open states.

See Also:
getOpenStates()

STATE_COUNT_EDEFAULT

protected static final int STATE_COUNT_EDEFAULT
The default value of the 'State Count' attribute.

See Also:
getStateCount(), Constant Field Values

TRANSITION_COUNT_EDEFAULT

protected static final int TRANSITION_COUNT_EDEFAULT
The default value of the 'Transition Count' attribute.

See Also:
getTransitionCount(), Constant Field Values

transitionCount

protected int transitionCount
The cached value of the 'Transition Count' attribute.

See Also:
getTransitionCount()

equalityHelper

protected EqualityHelper equalityHelper
The cached value of the 'Equality Helper' containment reference.

See Also:
getEqualityHelper()

LAYOUT_ZOOM_LEVEL_EDEFAULT

protected static final int LAYOUT_ZOOM_LEVEL_EDEFAULT
The default value of the 'Layout Zoom Level' attribute.

See Also:
getLayoutZoomLevel(), Constant Field Values

LAYOUT_STATE_REPULSION_EDEFAULT

protected static final int LAYOUT_STATE_REPULSION_EDEFAULT
The default value of the 'Layout State Repulsion' attribute.

See Also:
getLayoutStateRepulsion(), Constant Field Values

LAYOUT_TRANSITION_ATTRACTION_EDEFAULT

protected static final int LAYOUT_TRANSITION_ATTRACTION_EDEFAULT
The default value of the 'Layout Transition Attraction' attribute.

See Also:
getLayoutTransitionAttraction(), Constant Field Values

LAYOUT_HIDE_LABELS_EDEFAULT

protected static final boolean LAYOUT_HIDE_LABELS_EDEFAULT
The default value of the 'Layout Hide Labels' attribute.

See Also:
isLayoutHideLabels(), Constant Field Values

LAYOUT_HIDE_INDIZES_EDEFAULT

protected static final boolean LAYOUT_HIDE_INDIZES_EDEFAULT
The default value of the 'Layout Hide Indizes' attribute.

See Also:
isLayoutHideIndizes(), Constant Field Values

MAX_STATE_DISTANCE_EDEFAULT

protected static final int MAX_STATE_DISTANCE_EDEFAULT
The default value of the 'Max State Distance' attribute.

See Also:
getMaxStateDistance(), Constant Field Values

properties

protected EMap<String,String> properties
The cached value of the 'Properties' map.

See Also:
getProperties()

ALL_PARAMETER_KEYS_EDEFAULT

protected static final int[] ALL_PARAMETER_KEYS_EDEFAULT
The default value of the 'All Parameter Keys' attribute.

See Also:
getAllParameterKeys()
Constructor Detail

StateSpaceImpl

protected StateSpaceImpl()
Default constructor.


StateSpaceImpl

public StateSpaceImpl(Module module)
Constructor. Imports all rules of the given module.

Parameters:
module - Module which contains the rules to be used.
Method Detail

getOpenStates

public Set<State> getOpenStates()
Get the set of open states in this state space.

Specified by:
getOpenStates in interface StateSpace

getStateCount

public int getStateCount()
Description copied from interface: StateSpace
Get the number of states in this state space.

Specified by:
getStateCount in interface StateSpace
Returns:
the state count
See Also:
StateSpacePackage.getStateSpace_StateCount()

removeState

public boolean removeState(State state)
Remove a state and detach its transitions from the other states. The transitions are still connected to the removed node afterwards. All predecessor states are automatically marked as open.

Specified by:
removeState in interface StateSpace

updateEqualityHelper

public void updateEqualityHelper()
Specified by:
updateEqualityHelper in interface StateSpace

incTransitionCount

public int incTransitionCount()
Specified by:
incTransitionCount in interface StateSpace

getAllParameterKeys

public int[] getAllParameterKeys()
Description copied from interface: StateSpace
Get all object keys used as parameters in transitions in this state space.

Specified by:
getAllParameterKeys in interface StateSpace

getLayoutZoomLevel

public int getLayoutZoomLevel()
Description copied from interface: StateSpace
Get the zoom level to be used when this state space is displayed.

Specified by:
getLayoutZoomLevel in interface StateSpace
Returns:
the value of the 'Zoom Level' attribute.
See Also:
StateSpace.setLayoutZoomLevel(int)

setLayoutZoomLevel

public void setLayoutZoomLevel(int zoomLevel)
Description copied from interface: StateSpace
Set the zoom level for this state space.

Specified by:
setLayoutZoomLevel in interface StateSpace
Parameters:
zoomLevel - the new value of the 'Zoom Level' attribute.
See Also:
StateSpace.getLayoutZoomLevel()

getLayoutStateRepulsion

public int getLayoutStateRepulsion()
Description copied from interface: StateSpace
Get the state repulsion to be used when layouting this state space. The value is between 0..100.

Specified by:
getLayoutStateRepulsion in interface StateSpace
Returns:
the value of the 'State Repulsion' attribute.
See Also:
StateSpace.setLayoutStateRepulsion(int)

setLayoutStateRepulsion

public void setLayoutStateRepulsion(int repulsion)
Description copied from interface: StateSpace
Set the state repulsion to be used when layouting this state space.

Specified by:
setLayoutStateRepulsion in interface StateSpace
Parameters:
repulsion - the new value of the 'State Repulsion' attribute.
See Also:
StateSpace.getLayoutStateRepulsion()

getLayoutTransitionAttraction

public int getLayoutTransitionAttraction()
Description copied from interface: StateSpace
Get the transition attraction to be used when layouting this state space. The value is between 0..100.

Specified by:
getLayoutTransitionAttraction in interface StateSpace
Returns:
the value of the 'Transition Attraction' attribute.
See Also:
StateSpace.setLayoutTransitionAttraction(int)

setLayoutTransitionAttraction

public void setLayoutTransitionAttraction(int attraction)
Description copied from interface: StateSpace
Set the transition attraction to be used when layouting this state space. The value is between 0..100.

Specified by:
setLayoutTransitionAttraction in interface StateSpace
Parameters:
attraction - the new value of the 'Transition Attraction' attribute.
See Also:
StateSpace.getLayoutTransitionAttraction()

getMaxStateDistance

public int getMaxStateDistance()
Description copied from interface: StateSpace
Get the maximum distance of states from the initial states.

Specified by:
getMaxStateDistance in interface StateSpace
Returns:
the value of the 'Max State Distance' attribute.
See Also:
StateSpace.setMaxStateDistance(int), StateSpacePackage.getStateSpace_MaxStateDistance()

setMaxStateDistance

public void setMaxStateDistance(int maxStateDistance)
Description copied from interface: StateSpace
Set the maximum distance of states from the initial states.

Specified by:
setMaxStateDistance in interface StateSpace
Parameters:
maxStateDistance - the new value of the 'Max State Distance' attribute.
See Also:
StateSpace.getMaxStateDistance()

isLayoutHideLabels

public boolean isLayoutHideLabels()
Description copied from interface: StateSpace
Check whether labels should be hidden.

Specified by:
isLayoutHideLabels in interface StateSpace
Returns:
the value of the 'Hide Labels' attribute.
See Also:
StateSpace.setLayoutHideLabels(boolean), org.eclipse.emf.henshin.statespace.StateSpacePackage#getStateSpace_HideLabels()

setLayoutHideLabels

public void setLayoutHideLabels(boolean hideLabels)
Description copied from interface: StateSpace
Set the hide-labels flag.

Specified by:
setLayoutHideLabels in interface StateSpace
Parameters:
hideLabels - the new value of the 'Hide Labels' attribute.
See Also:
StateSpace.isLayoutHideLabels()

isLayoutHideIndizes

public boolean isLayoutHideIndizes()
Description copied from interface: StateSpace
Returns the value of the 'Layout Hide Indizes' attribute.

Specified by:
isLayoutHideIndizes in interface StateSpace
Returns:
the value of the 'Layout Hide Indizes' attribute.
See Also:
StateSpace.setLayoutHideIndizes(boolean), StateSpacePackage.getStateSpace_LayoutHideIndizes()

setLayoutHideIndizes

public void setLayoutHideIndizes(boolean hideIndizes)
Description copied from interface: StateSpace
Sets the value of the 'Layout Hide Indizes' attribute.

Specified by:
setLayoutHideIndizes in interface StateSpace
Parameters:
hideIndizes - the new value of the 'Layout Hide Indizes' attribute.
See Also:
StateSpace.isLayoutHideIndizes()

eStaticClass

protected EClass eStaticClass()
Overrides:
eStaticClass in class StorageImpl

getStates

public EList<State> getStates()
Get the list of states in this state space.

Specified by:
getStates in interface StateSpace

getInitialStates

public EList<State> getInitialStates()

Specified by:
getInitialStates in interface StateSpace

getRules

public EList<Rule> getRules()

Specified by:
getRules in interface StateSpace

getTransitionCount

public int getTransitionCount()

Specified by:
getTransitionCount in interface StateSpace
See Also:
StateSpace.setTransitionCount(int)

setTransitionCount

public void setTransitionCount(int newTransitionCount)

Specified by:
setTransitionCount in interface StateSpace
See Also:
StateSpace.getTransitionCount()

getEqualityHelper

public EqualityHelper getEqualityHelper()

Specified by:
getEqualityHelper in interface StateSpace
See Also:
StateSpace.setEqualityHelper(EqualityHelper)

getProperties

public EMap<String,String> getProperties()

Specified by:
getProperties in interface StateSpace
Returns:
the value of the 'Properties' map.
See Also:
StateSpacePackage.getStateSpace_Properties()

basicSetEqualityHelper

public NotificationChain basicSetEqualityHelper(EqualityHelper newEqualityHelper,
                                                NotificationChain msgs)

setEqualityHelper

public void setEqualityHelper(EqualityHelper newEqualityHelper)
Description copied from interface: StateSpace
Set the equality helper for this state space.

Specified by:
setEqualityHelper in interface StateSpace
Parameters:
newEqualityHelper - the new equality helper.
See Also:
StateSpace.getEqualityHelper()

eInverseAdd

public NotificationChain eInverseAdd(InternalEObject otherEnd,
                                     int featureID,
                                     NotificationChain msgs)
Overrides:
eInverseAdd in class BasicEObjectImpl

eInverseRemove

public NotificationChain eInverseRemove(InternalEObject otherEnd,
                                        int featureID,
                                        NotificationChain msgs)
Overrides:
eInverseRemove in class BasicEObjectImpl

eGet

public Object eGet(int featureID,
                   boolean resolve,
                   boolean coreType)
Specified by:
eGet in interface InternalEObject
Overrides:
eGet in class StorageImpl

eSet

public void eSet(int featureID,
                 Object newValue)
Specified by:
eSet in interface InternalEObject
Overrides:
eSet in class StorageImpl

eUnset

public void eUnset(int featureID)
Specified by:
eUnset in interface InternalEObject
Overrides:
eUnset in class StorageImpl

eIsSet

public boolean eIsSet(int featureID)
Specified by:
eIsSet in interface InternalEObject
Overrides:
eIsSet in class StorageImpl

toString

public String toString()

Overrides:
toString in class StorageImpl