ConForM.CoopnTools.CoKer.SpecMgr
Class SpecSymbol

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.SpecMgr.SpecElement
        |
        +--ConForM.CoopnTools.CoKer.SpecMgr.SpecSymbol
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, CoopnSyntacticSymbol, java.io.Serializable
Direct Known Subclasses:
SpecConstraintSymbol, SpecScenarioSymbol, SpecSourceSymbol, SpecTestSymbol, SpecVariableSymbol

public abstract class SpecSymbol
extends SpecElement
implements CoopnSyntacticSymbol

Specification symbols. This abstract class essentially defines basic symbols in the specification file abstract syntax.

See Also:
SpecElement, Serialized Form

Field Summary
protected  java.lang.String comment
           
protected  java.lang.String symbolIdentifier
           
protected  java.lang.String symbolModule
           
protected  java.lang.String symbolName
           
 
Constructor Summary
protected SpecSymbol(java.lang.String name, java.lang.String module, java.lang.String comment)
          Simple constructor.
protected SpecSymbol(java.lang.String name, java.lang.String identifier, java.lang.String module, java.lang.String comment)
          Simple constructor.
 
Method Summary
 java.lang.Object clone()
          Cloning method.
 java.lang.String comment()
          Return the associated comment.
 boolean equals(java.lang.Object s)
          Equality method.
 int hashCode()
          Hashcode method.
 java.lang.String identifier()
          Return the identifier.
 java.lang.String symbolModule()
          Return the module name as a string.
 int symbolModuleKind()
          Get the module kind (in the sense of the package manager) of the module defining the symbol, for instance COOPNSOURCE, COALASOURCE, PACKAGE, and so on).
 java.lang.String symbolName()
          Return the name as a string.
 java.lang.String toString(CoopnEnv env, int indent)
          String conversion method.
 java.lang.Object unmodifiableCopy()
          Copy the element into an unmodififable structure.
 
Methods inherited from class ConForM.CoopnTools.CoKer.SpecMgr.SpecElement
cloneSpecElement, toCompleteString, toCompleteString, toCompleteString, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ConForM.CoopnTools.CoKer.CoopnSyntacticSymbol
kind
 
Methods inherited from interface ConForM.CoopnTools.CoKer.CoopnSyntacticElement
toCompleteString, toCompleteString, toCompleteString, toString, toString
 

Field Detail

symbolName

protected java.lang.String symbolName

symbolIdentifier

protected java.lang.String symbolIdentifier

symbolModule

protected java.lang.String symbolModule

comment

protected java.lang.String comment
Constructor Detail

SpecSymbol

protected SpecSymbol(java.lang.String name,
                     java.lang.String identifier,
                     java.lang.String module,
                     java.lang.String comment)
              throws java.lang.IllegalArgumentException
Simple constructor.
Parameters:
name - the name. May be null if symbol has no name.
identifier - the identifier. The identifier is merely used for the convenience of users, allowing them to identify symbols even when they have no names. Identifiers are not taking part in symbol comparisons, for equality and for equivalence.
module - the definition module. Cannot be null.
Throws:
java.lang.IllegalArgumentException - identifier or module are null references.

SpecSymbol

protected SpecSymbol(java.lang.String name,
                     java.lang.String module,
                     java.lang.String comment)
              throws java.lang.IllegalArgumentException
Simple constructor.
Parameters:
name - the name and the identifier of the symbol. Cannot be null.
module - the definition module. Cannot be null.
Throws:
java.lang.IllegalArgumentException - name or module are null references.
Method Detail

symbolName

public final java.lang.String symbolName()
Return the name as a string.
Specified by:
symbolName in interface CoopnSyntacticSymbol
Returns:
the name

identifier

public final java.lang.String identifier()
Return the identifier.
Specified by:
identifier in interface CoopnSyntacticSymbol
Returns:
the identifier

symbolModule

public final java.lang.String symbolModule()
Return the module name as a string.
Specified by:
symbolModule in interface CoopnSyntacticSymbol
Returns:
the module name

symbolModuleKind

public int symbolModuleKind()
Get the module kind (in the sense of the package manager) of the module defining the symbol, for instance COOPNSOURCE, COALASOURCE, PACKAGE, and so on).
Specified by:
symbolModuleKind in interface CoopnSyntacticSymbol
Returns:
the module kind.

comment

public final java.lang.String comment()
Return the associated comment.
Specified by:
comment in interface CoopnSyntacticSymbol
Returns:
the associated comment or null.

equals

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

hashCode

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

toString

public java.lang.String toString(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 readable from users. The string representation is not required to include the comments associated to the element, if any.
Specified by:
toString in interface CoopnSyntacticElement
Overrides:
toString in class SpecElement
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.

unmodifiableCopy

public java.lang.Object unmodifiableCopy()
Copy the element into an unmodififable structure.
Overrides:
unmodifiableCopy in class SpecElement
Returns:
an unmodififable clone of the element.

clone

public java.lang.Object clone()
Description copied from interface: CoopnSyntacticElement
Cloning method. Must be defined in the inherited classes.
Specified by:
clone in interface CoopnSyntacticElement
Overrides:
clone in class SpecElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Returns:
a clone object.