ConForM.CoopnTools.CoKer.CoalaMgr
Class SymbolCollection

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoalaMgr.SymbolCollection
All Implemented Interfaces:
CoalaSymbolCollectionConstants, CoopnModuleDependency, CoopnTypeRelation

public abstract class SymbolCollection
extends java.lang.Object
implements CoalaSymbolCollectionConstants, CoopnModuleDependency, CoopnTypeRelation

Collection of coala symbols.

See Also:
CoalaElement

Fields inherited from interface ConForM.CoopnTools.CoKer.CoalaMgr.CoalaSymbolCollectionConstants
EXCEPTION, HANDLER, OBJECT, RESOLUTION, ROLE, SYMBOLKINDNUMBER, USE, USECAA, VARIABLE
 
Constructor Summary
protected SymbolCollection(CoopnBridge interfaceCoopnSymbols, CoopnBridge bodyCoopnSymbols)
          Simple constructor.
 
Method Summary
protected  int add(CoalaSymbol symbol, boolean defined, boolean external)
          Add a symbol.
 CoopnBridge bodyCoopnSymbols()
          Get the associated body coopn symbols.
abstract  java.lang.Object clone()
           
protected  SymbolCollection cloneSymbolCollection()
           
 boolean defined(int index, int kind)
          get the defined status of a symbol.
 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)
           
 boolean external(int index, int kind)
          get the external status of a symbol.
 int hashCode()
           
protected  int index(CoalaSymbol symbol)
          get the integer associated to a symbol.
 CoopnBridge interfaceCoopnSymbols()
          Get the associated interface coopn symbols.
 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 size(int kind)
          get the number of symbols of a particular kind.
 CoalaSymbol symbol(int index, int kind)
          get a symbol.
 int symbolKindNumber()
           
 int symbolToKind(CoalaSymbol s)
           
 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.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolCollection

protected SymbolCollection(CoopnBridge interfaceCoopnSymbols,
                           CoopnBridge bodyCoopnSymbols)
                    throws java.lang.IllegalArgumentException
Simple constructor.
Method Detail

symbolKindNumber

public int symbolKindNumber()

symbolToKind

public int symbolToKind(CoalaSymbol s)

add

protected int add(CoalaSymbol symbol,
                  boolean defined,
                  boolean external)
Add a symbol.
Parameters:
symbol - the symbol to add
defined - true iff the symbol is defined
external - true iff the symbol is exported
Returns:
an integer associated to the symbol. This integer, along with the type of the symbol, identifies the symbol in the collection.

index

protected int index(CoalaSymbol symbol)
get the integer associated to a symbol.
Parameters:
symbol - the symbol to add
Returns:
the integer associated to the symbol, or -1 of the symbol is not in the table.

size

public int size(int kind)
get the number of symbols of a particular kind.
Parameters:
kind - the symbol kind
Returns:
the number of symbols of a particular kind

symbol

public CoalaSymbol symbol(int index,
                          int kind)
get a symbol.
Parameters:
index - the integer associated to the symbol
kind - the symbol kind
Returns:
the symbol.

defined

public boolean defined(int index,
                       int kind)
get the defined status of a symbol.
Parameters:
index - the integer associated to the symbol
kind - the symbol kind
Returns:
the defined status of the symbol.

external

public boolean external(int index,
                        int kind)
get the external status of a symbol.
Parameters:
index - the integer associated to the symbol
kind - the symbol kind
Returns:
the external status of the symbol.

interfaceCoopnSymbols

public CoopnBridge interfaceCoopnSymbols()
Get the associated interface coopn symbols.
Returns:
the associated interface coopn SymbolCollection.

bodyCoopnSymbols

public CoopnBridge bodyCoopnSymbols()
Get the associated body coopn symbols.
Returns:
the associated body coopn SymbolCollection.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

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.

cloneSymbolCollection

protected SymbolCollection cloneSymbolCollection()

clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object