ConForM.CoopnTools.CoKer.ConstraintsMgr
Class ConstraintsModule

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.ConstraintsMgr.ConstraintsElement
        |
        +--ConForM.CoopnTools.CoKer.ConstraintsMgr.ConstraintsModule
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, CoopnSyntacticModule, java.io.Serializable

public class ConstraintsModule
extends ConstraintsElement
implements CoopnSyntacticModule

Constraints module. A module is composed of a public section (interface) and a private one (body)

See Also:
ConstraintsElement, Serialized Form

Field Summary
protected  java.lang.String comment
           
 
Constructor Summary
ConstraintsModule(java.lang.String moduleName, CoopnCompilInfo info, ConstraintsInterface inter, ConstraintsBody body, java.lang.String comment)
          Simple constructor
 
Method Summary
 ConstraintsBody body()
          returns the body of this module
 java.lang.Object clone()
          Cloning method
 java.lang.String comment()
          returns the comment
 CoopnCompilInfo compilInfo()
          returns the compilation info of this module
 java.lang.String completeKind()
          Complete kind retrieving method.
 boolean equals(java.lang.Object obj)
          Compares 2 objects
 int hashCode()
          produces the hashcode for this module
 boolean hasParameters()
          Look if this module has parameters,i.e. additional information to the complete kind.
 ConstraintsInterface inter()
          returns the interface of this module
 java.lang.String kind()
          Kind retrieving method.
 int moduleKind()
          Retrieves the kind of this module
 java.lang.String moduleName()
          returns the name of this module
 java.lang.String parameters()
          Parameters retrieving method.
 CoopnSyntacticSection[] sections()
          Get the sections of this module
 void setComment(java.lang.String comment)
          Set the comment.
 java.lang.String toCompleteString(CoopnEnv env, int indent)
          Complete string conversion method.
 java.lang.String toString(CoopnEnv env, int indent)
          String conversion method
 java.lang.Object unmodifiableCopy()
          produces an unmodifiable copy of this module
 
Methods inherited from class ConForM.CoopnTools.CoKer.ConstraintsMgr.ConstraintsElement
cloneConstraintsElement, 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.CoopnSyntacticElement
toCompleteString, toCompleteString, toString, toString
 

Field Detail

comment

protected java.lang.String comment
Constructor Detail

ConstraintsModule

public ConstraintsModule(java.lang.String moduleName,
                         CoopnCompilInfo info,
                         ConstraintsInterface inter,
                         ConstraintsBody body,
                         java.lang.String comment)
Simple constructor
Parameters:
moduleName - the Name of this module
info - compilation information about this module
inter - interface of this module
body - body of this module
comment - comment about this module
Method Detail

moduleName

public java.lang.String moduleName()
returns the name of this module
Specified by:
moduleName in interface CoopnSyntacticModule
Returns:
the name of this module

compilInfo

public CoopnCompilInfo compilInfo()
returns the compilation info of this module
Specified by:
compilInfo in interface CoopnSyntacticModule
Returns:
the compilation info of this module

completeKind

public java.lang.String completeKind()
Complete kind retrieving method. This method must be defined in the inherited classes for returning a string allowing the user to know what kind of module this is, including building information such as "generic" or "abstract".
Specified by:
completeKind in interface CoopnSyntacticModule
Returns:
a string defining the module complete kind.

hasParameters

public boolean hasParameters()
Look if this module has parameters,i.e. additional information to the complete kind.
Specified by:
hasParameters in interface CoopnSyntacticModule
Returns:
boolean iff this module has parameters.

parameters

public java.lang.String parameters()
Parameters retrieving method. Parameters are additional information to the complete kind.
Specified by:
parameters in interface CoopnSyntacticModule
Returns:
a string defining the paremeters, or null.

inter

public ConstraintsInterface inter()
returns the interface of this module
Returns:
the interface of this module

body

public ConstraintsBody body()
returns the body of this module
Returns:
the body of this module

comment

public java.lang.String comment()
returns the comment
Specified by:
comment in interface CoopnSyntacticModule
Returns:
the comment of this module

setComment

public void setComment(java.lang.String comment)
                throws java.lang.UnsupportedOperationException
Set the comment.
Parameters:
comment - the new comment
Throws:
java.lang.UnsupportedOperationException - the module is not modifiable.

kind

public java.lang.String kind()
Kind retrieving method. This method must be defined in the inherited classes for returning a string allowing the user to know what kind of section this is.
Specified by:
kind in interface CoopnSyntacticModule
Returns:
a string defining the section kind.

sections

public CoopnSyntacticSection[] sections()
Get the sections of this module
Specified by:
sections in interface CoopnSyntacticModule
Returns:
the sections defined in this module

equals

public boolean equals(java.lang.Object obj)
Compares 2 objects
Specified by:
equals in interface CoopnSyntacticElement
Overrides:
equals in class ConstraintsElement
Parameters:
obj - the object to compare
Returns:
if true this modules and obj are equal

hashCode

public int hashCode()
produces the hashcode for this module
Specified by:
hashCode in interface CoopnSyntacticElement
Overrides:
hashCode in class ConstraintsElement
Returns:
the hashcode for this module

toCompleteString

public java.lang.String toCompleteString(CoopnEnv env,
                                         int indent)
Complete string conversion method. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toCompleteString in interface CoopnSyntacticElement
Overrides:
toCompleteString in class ConstraintsElement
Parameters:
env - the environment deciding the form of the display
indent - the identation factor
Returns:
a String image of the element.

toString

public java.lang.String toString(CoopnEnv env,
                                 int indent)
String conversion method
Specified by:
toString in interface CoopnSyntacticElement
Overrides:
toString in class ConstraintsElement
Parameters:
env - the coopn environment to use
indent - the indentation to use
Returns:
the resulting strint that represents this module

moduleKind

public int moduleKind()
Retrieves the kind of this module
Specified by:
moduleKind in interface CoopnSyntacticModule
Returns:
the kind of this module

unmodifiableCopy

public java.lang.Object unmodifiableCopy()
produces an unmodifiable copy of this module
Overrides:
unmodifiableCopy in class ConstraintsElement
Returns:
an unmodifiable copy of this module

clone

public java.lang.Object clone()
Cloning method
Specified by:
clone in interface CoopnSyntacticElement
Overrides:
clone in class ConstraintsElement
Returns:
a clone object of this module