ConForM.CoopnTools.CoKer.CoopnMgr
Class CoopnModule

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
        |
        +--ConForM.CoopnTools.CoKer.CoopnMgr.CoopnModule
All Implemented Interfaces:
java.lang.Cloneable, CoopnModuleDependency, CoopnSyntacticElement, CoopnSyntacticModule, CoopnTypeRelation, java.io.Serializable
Direct Known Subclasses:
CoopnAdtModule, CoopnClassModule, CoopnContextModule, CoopnMorphismModule

public abstract class CoopnModule
extends CoopnElement
implements CoopnSyntacticModule, CoopnModuleDependency, CoopnTypeRelation

Coopn module.

See Also:
CoopnElement, Serialized Form

Field Summary
static int ADT
           
static int CLASS
           
protected  java.lang.String comment
           
static int CONTEXT
           
protected  CoopnHeader header
           
protected  CoopnCompilInfo info
           
protected  CoopnInheritList inherits
           
protected  int kind
           
static int MORPHISM
           
protected  CoopnSymbolTable table
           
 
Constructor Summary
protected CoopnModule(CoopnCompilInfo info, CoopnSymbolTable table, int kind, CoopnHeader header, CoopnInheritList inherits)
          Simple constructor.
protected CoopnModule(CoopnCompilInfo info, CoopnSymbolTable table, int kind, CoopnHeader header, CoopnInheritList inherits, java.lang.String comment)
          Simple constructor.
 
Method Summary
 java.lang.Object clone()
          Cloning method.
 java.lang.String comment()
          Comment retrieving method.
 CoopnCompilInfo compilInfo()
          Return the compilation information associated to this module.
 java.lang.String[] dependencies()
          Module dependency.
 boolean equ(CoopnTypeAgg left, CoopnTypeAgg right)
          Equivalence between two lists of types.
 boolean equ(CoopnType left, CoopnType right)
          Equivalence between two types.
 boolean equals(java.lang.Object obj)
          Equality method.
 int hashCode()
          Hashcode method.
 boolean hasInherits()
           
 boolean hasParameters()
          Look if this module has parameters,i.e. additional information to the complete kind.
 CoopnHeader header()
           
 java.lang.String headerCompleteString()
           
 java.lang.String headerCompleteString(CoopnEnv env)
           
 java.lang.String headerString()
           
 java.lang.String headerString(CoopnEnv env)
           
 CoopnCompilInfo info()
           
 CoopnInheritList inherits()
           
 CoopnElement interpret(CoopnSubstitution sigma)
          Interpretation of this element according to a substitution.
abstract  java.lang.String kind()
          Kind retrieving method.
 boolean less(CoopnTypeAgg sub, CoopnTypeAgg sup)
          Order between two lists of types.
 boolean less(CoopnType sub, CoopnType sup)
          Order between two types.
 boolean lessOrEqu(CoopnTypeAgg sub, CoopnTypeAgg sup)
          Order between two lists of types.
 boolean lessOrEqu(CoopnType sub, CoopnType sup)
          Order between two types.
 int mkind()
           
 int moduleKind()
          Get the module kind (in the sense of the package manager) of this module, for instance COOPNSOURCE, COALASOURCE, PACKAGE, and so on).
 java.lang.String moduleName()
          Get the name.
 java.lang.String parameters()
          Parameters retrieving method.
 boolean pureCOIL()
          Pure COIL-COOPN2C verification method.
 boolean pureCOOPN()
          Pure COOPN verification method.
abstract  CoopnSyntacticSection[] sections()
          Get the sections of this module.
 CoopnSymbolTable symbolTable()
           
 ConForM.CoopnTools.CoKer.CoopnMgr.CoopnCocoMgr.CoopnCocoModule toCoco()
          To compact Coopn transformation.
 boolean unifiable(CoopnTypeAgg left, CoopnTypeAgg right)
          Compatibility for unification between two lists of types.
 boolean unifiable(CoopnType left, CoopnType right)
          Compatibility for unification between two types.
 java.lang.Object unmodifiableCopy()
          Copy the element into an unmodifiable structure.
 void useSymbolTable(CoopnSymbolTable table)
           
static boolean validKind(int kind)
           
 
Methods inherited from class ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
cloneCoopnElement, toCoco, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteText, toCompleteText, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toCompleteTokens, toString, toString, toString, toText, toTokens, toTokens, toTokens
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ConForM.CoopnTools.CoKer.CoopnSyntacticModule
completeKind
 
Methods inherited from interface ConForM.CoopnTools.CoKer.CoopnSyntacticElement
toCompleteString, toCompleteString, toCompleteString, toString, toString, toString
 

Field Detail

ADT

public static final int ADT

CLASS

public static final int CLASS

CONTEXT

public static final int CONTEXT

MORPHISM

public static final int MORPHISM

kind

protected int kind

header

protected CoopnHeader header

inherits

protected CoopnInheritList inherits

info

protected CoopnCompilInfo info

table

protected CoopnSymbolTable table

comment

protected java.lang.String comment
Constructor Detail

CoopnModule

protected CoopnModule(CoopnCompilInfo info,
                      CoopnSymbolTable table,
                      int kind,
                      CoopnHeader header,
                      CoopnInheritList inherits)
Simple constructor.

CoopnModule

protected CoopnModule(CoopnCompilInfo info,
                      CoopnSymbolTable table,
                      int kind,
                      CoopnHeader header,
                      CoopnInheritList inherits,
                      java.lang.String comment)
Simple constructor.
Method Detail

pureCOOPN

public boolean pureCOOPN()
Description copied from class: CoopnElement
Pure COOPN verification method. Must be modified by the elements which may alterate the result.
Overrides:
pureCOOPN in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
true iff this object is in pure CO-OPN language.

pureCOIL

public boolean pureCOIL()
Description copied from class: CoopnElement
Pure COIL-COOPN2C verification method. Must be modified by the elements which may alterate the result.
Overrides:
pureCOIL in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Returns:
true iff this object is in pure COIL language.

validKind

public static boolean validKind(int kind)

interpret

public CoopnElement interpret(CoopnSubstitution sigma)
Description copied from class: CoopnElement
Interpretation of this element according to a substitution.
Overrides:
interpret in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
Parameters:
sigma - the substitution; cannot be null
Returns:
a new CoopnElement object, coreesponding to the interpretation.

useSymbolTable

public void useSymbolTable(CoopnSymbolTable table)

moduleName

public java.lang.String moduleName()
Description copied from interface: CoopnSyntacticModule
Get the name. Must be defined in the inherited classes.
Specified by:
moduleName in interface CoopnSyntacticModule
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticModule
Returns:
a String representation of the module name. Never null.

mkind

public int mkind()

comment

public java.lang.String comment()
Description copied from interface: CoopnSyntacticModule
Comment retrieving method. This method must be defined in the inherited classes for returning the comment associated to this symbol.
Specified by:
comment in interface CoopnSyntacticModule
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticModule
Returns:
a string defining the associated comment, or null iff no comment is associated to this symbol.

moduleKind

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

kind

public abstract java.lang.String kind()
Description copied from interface: CoopnSyntacticModule
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, for instance "Class", "Aspect", or "CAA".
Specified by:
kind in interface CoopnSyntacticModule
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticModule
Returns:
a string defining the module kind.

sections

public abstract CoopnSyntacticSection[] sections()
Description copied from interface: CoopnSyntacticModule
Get the sections of this module.
Specified by:
sections in interface CoopnSyntacticModule
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticModule
Returns:
The sections defined by this module.

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.

header

public CoopnHeader header()

inherits

public CoopnInheritList inherits()

compilInfo

public CoopnCompilInfo compilInfo()
Description copied from interface: CoopnSyntacticModule
Return the compilation information associated to this module.
Specified by:
compilInfo in interface CoopnSyntacticModule

info

public CoopnCompilInfo info()

symbolTable

public CoopnSymbolTable symbolTable()

dependencies

public java.lang.String[] dependencies()
Description copied from interface: CoopnModuleDependency
Module dependency.
Specified by:
dependencies in interface CoopnModuleDependency
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnModuleDependency
Returns:
an array of strings containing names of modules.

equ

public boolean equ(CoopnTypeAgg left,
                   CoopnTypeAgg right)
Description copied from interface: CoopnTypeRelation
Equivalence between two lists of types.
Specified by:
equ in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
left - the first list of types
right - the second list of types
Returns:
true iff both lists of types are equivalents with regard to the type relation represented by this object.

equ

public boolean equ(CoopnType left,
                   CoopnType right)
Description copied from interface: CoopnTypeRelation
Equivalence between two types.
Specified by:
equ in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
left - the first type
right - the second type
Returns:
true iff both types are equivalents with regard to the type relation represented by this object.

less

public boolean less(CoopnTypeAgg sub,
                    CoopnTypeAgg sup)
Description copied from interface: CoopnTypeRelation
Order between two lists of types.
Specified by:
less in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
sub - the first list of types
sup - the second list of types
Returns:
true iff sub is less or equal to sup AND at least one element of sub is strictly less than the same element of sup.

less

public boolean less(CoopnType sub,
                    CoopnType sup)
Description copied from interface: CoopnTypeRelation
Order between two types.
Specified by:
less in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
sub - the first type
sup - the second type
Returns:
true iff sub is a strict sub-sort or a sub-type of sup.

lessOrEqu

public boolean lessOrEqu(CoopnTypeAgg sub,
                         CoopnTypeAgg sup)
Description copied from interface: CoopnTypeRelation
Order between two lists of types.
Specified by:
lessOrEqu in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
sub - the first list of types
sup - the second list of types
Returns:
true iff every element of sub is a sub-sort or a sub-type of the same (indexed) element sup.

lessOrEqu

public boolean lessOrEqu(CoopnType sub,
                         CoopnType sup)
Description copied from interface: CoopnTypeRelation
Order between two types.
Specified by:
lessOrEqu in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
sub - the first type
sup - the second type
Returns:
true iff sub is a sub-sort or a sub-type of sup.

unifiable

public boolean unifiable(CoopnTypeAgg left,
                         CoopnTypeAgg right)
Description copied from interface: CoopnTypeRelation
Compatibility for unification between two lists of types.
Specified by:
unifiable in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
left - the first list of types
right - the second list of types
Returns:
true iff both types of every (indexed) element are compatibles with regard to the type relation represented by this object.

unifiable

public boolean unifiable(CoopnType left,
                         CoopnType right)
Description copied from interface: CoopnTypeRelation
Compatibility for unification between two types.
Specified by:
unifiable in interface CoopnTypeRelation
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnTypeRelation
Parameters:
left - the first type
right - the second type
Returns:
true iff both types are compatibles with regard to the type relation represented by this object.

hasInherits

public boolean hasInherits()

toCoco

public ConForM.CoopnTools.CoKer.CoopnMgr.CoopnCocoMgr.CoopnCocoModule toCoco()
                                                                      throws java.lang.IllegalArgumentException
To compact Coopn transformation.
Returns:
the Coopn Compact form of this module
Throws:
java.lang.IllegalArgumentException - indicicates that the module is not consistent, i.e. that some referenced symbols are not found or invalid in the symbol table.

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: CoopnSyntacticElement
Equality method. Must be defined in the inherited classes.
Specified by:
equals in interface CoopnSyntacticElement
Overrides:
equals in class CoopnElement
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 CoopnElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Returns:
the hash code.

headerString

public java.lang.String headerString(CoopnEnv env)

headerString

public java.lang.String headerString()

headerCompleteString

public java.lang.String headerCompleteString(CoopnEnv env)

headerCompleteString

public java.lang.String headerCompleteString()

unmodifiableCopy

public java.lang.Object unmodifiableCopy()
Description copied from class: CoopnElement
Copy the element into an unmodifiable structure.
Overrides:
unmodifiableCopy in class CoopnElement
Following copied from class: ConForM.CoopnTools.CoKer.CoopnMgr.CoopnElement
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 CoopnElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Returns:
a clone object.