ConForM.CoopnTools.CoKer.ScenarioMgr
Class ObjectState

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
        |
        +--ConForM.CoopnTools.CoKer.ScenarioMgr.ObjectState
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, java.io.Serializable

public class ObjectState
extends ScenarioElement

Object states in the CO-OPN semantics.

See Also:
Serialized Form

Constructor Summary
ObjectState(CoopnTerm oid)
           
 
Method Summary
 void addMarking(CoopnMark mark)
           
 void addSharedMarking(CoopnMark mark)
           
 java.lang.Object clone()
          Cloning method.
 int countMarking(CoopnMark mark)
          Return the number of occurence of a particular mark in the marking. of this state.
 int countSharedMarking(CoopnMark mark)
          Return the number of occurence of a particular mark in the shared marking. of this state.
 boolean equals(java.lang.Object o)
          Equality method.
 int hashCode()
          Hashcode method.
 boolean hasMarking()
          Test if this object state has a marking part.
 boolean hasSharedMarking()
          Test if this object state has a shared marking part.
 ScenarioElement interpret(CoopnSubstitution sigma)
          Interpretation of this element according to a substitution.
 java.util.List marking()
          Get the image of the marking of this object.
 CoopnTerm oid()
          Get the oid.
 void removeMarking(CoopnMark mark)
           
 void removeSharedMarking(CoopnMark mark)
           
 java.util.List sharedMarking()
          Get the image of the shared marking of this object.
 java.lang.String toCompleteString(CoopnEnv env, int indent)
          String conversion method.
 java.lang.String toString(CoopnEnv env, int indent)
          String conversion method.
 
Methods inherited from class ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
cloneScenarioElement, toCompleteString, toCompleteString, toCompleteString, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectState

public ObjectState(CoopnTerm oid)
Method Detail

oid

public CoopnTerm oid()
Get the oid.

addMarking

public void addMarking(CoopnMark mark)

removeMarking

public void removeMarking(CoopnMark mark)

countMarking

public int countMarking(CoopnMark mark)
Return the number of occurence of a particular mark in the marking. of this state.
Returns:
0 if the mark is not part of the marking of this state, or the number of occurence of the mark in the marking of this state.

addSharedMarking

public void addSharedMarking(CoopnMark mark)

removeSharedMarking

public void removeSharedMarking(CoopnMark mark)

countSharedMarking

public int countSharedMarking(CoopnMark mark)
Return the number of occurence of a particular mark in the shared marking. of this state.
Returns:
0 if the mark is not part of the shared marking of this state, or the number of occurence of the mark in the shared marking of this state.

interpret

public ScenarioElement interpret(CoopnSubstitution sigma)
Interpretation of this element according to a substitution.
Overrides:
interpret in class ScenarioElement
Parameters:
sigma - the substitution; cannot be null
Returns:
a new ScenarioElement object, coreesponding to the interpretation.

equals

public boolean equals(java.lang.Object o)
Description copied from class: ScenarioElement
Equality method. Must be defined in the inherited classes.
Overrides:
equals in class ScenarioElement
Following copied from class: ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
Parameters:
obj - the object to compare
Returns:
true iff this object and the parameter are equals.

hashCode

public int hashCode()
Description copied from class: ScenarioElement
Hashcode method. Must be defined in the inherited classes.
Overrides:
hashCode in class ScenarioElement
Following copied from class: ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
Returns:
the hash code.

toString

public java.lang.String toString(CoopnEnv env,
                                 int indent)
Description copied from class: ScenarioElement
String conversion method. This routine converts an element into a string representing it, by transforming it using toText.
Overrides:
toString in class ScenarioElement
Following copied from class: ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
Parameters:
env - the environment deciding the form of the display
indent - the identation factor
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnEnv env,
                                         int indent)
Description copied from interface: CoopnSyntacticElement
String conversion method. This routine converts an element into a string representing it. The string representation is intended to be as complete as possible, even if the resulting string is not more readable. The string representation is not required to include the comments associated to the element, if any.
Overrides:
toCompleteString in class ScenarioElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display. A null values indicates a default form.
indent - the identation factor. A zero value indicates no indentation at all.
Returns:
a String image of the element.

marking

public java.util.List marking()
Get the image of the marking of this object. This method build and return a new List each time it is called. Therefore: (1) the returned list can be modified without affecting the state; (2) avoid calls to this method if not necessary; for instance, to know if a particular mark belongs to this marking, use method countMarking() instead of calling this method and browsing the list.
Returns:
a List of (unmodifiable) CoopnMarks.

hasMarking

public boolean hasMarking()
Test if this object state has a marking part.

sharedMarking

public java.util.List sharedMarking()
Get the image of the shared marking of this object. This method build and return a new List each time it is called. Therefore: (1) the returned list can be modified without affecting the state; (2) avoid calls to this method if not necessary; for instance, to know if a particular mark belongs to this marking, use method countSharedMarking() instead of calling this method and browsing the list.
Returns:
a List of (unmodifiable) CoopnMarks.

hasSharedMarking

public boolean hasSharedMarking()
Test if this object state has a shared marking part.

clone

public java.lang.Object clone()
Cloning method.
Overrides:
clone in class ScenarioElement
Following copied from class: ConForM.CoopnTools.CoKer.ScenarioMgr.ScenarioElement
Returns:
a clone object.