JML

org.multijava.mjc
Class CGFCollectionMap

java.lang.Object
  extended byorg.multijava.util.Utils
      extended byorg.multijava.mjc.CGFCollectionMap
All Implemented Interfaces:
Cloneable

public class CGFCollectionMap
extends Utils

This represents a mapping from compilation units and strings to sets of collections of generic functions: CGFCollectionMap: CCompilationUnit x String -> { CGFCollection }. Instances of this are stored within CCompilationUnit instances and so the mapping is directly from strings to sets of collections of generic functions.

This is used to process unveiling references to external generic functions. Each generic function import for a compilation unit generates an entry in this map. When an unveiling reference is encountered during typechecking this map is consulted to find the set of generic function collections that should be made visible. This is a set since multiple generic functions with the same name may be imported from different packages. Each collection in the set is then processed to augment the appropriate classes.

See Also:
CCompilationUnit, JCompilationUnit, CGenericFunctionCollection, CAugmentationMap

Nested Class Summary
static class CGFCollectionMap.SetMap
           
 
Field Summary
private  CGFCollectionMap.SetMap backingMap
           
 
Fields inherited from class org.multijava.util.Utils
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO
 
Constructor Summary
CGFCollectionMap()
           
 
Method Summary
 CGenericFunctionCollection[] getCollectionsFor(String ident)
          Returns all the generic function collections mapped to by ident.
 void register(String ident, CGenericFunctionCollection coll)
          Adds a mapping from the given identifier to the given generic function collection.
 void registerAll(String ident, Set collSet)
          Adds a mapping from the given ident to each of the collections in the given set.
 
Methods inherited from class org.multijava.util.Utils
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backingMap

private CGFCollectionMap.SetMap backingMap
Constructor Detail

CGFCollectionMap

public CGFCollectionMap()
Method Detail

register

public void register(String ident,
                     CGenericFunctionCollection coll)
Adds a mapping from the given identifier to the given generic function collection.


registerAll

public void registerAll(String ident,
                        Set collSet)
Adds a mapping from the given ident to each of the collections in the given set.

 requires (\forall Object o; collSet.contains(o); 
			 o instanceof CGenericFunctionCollection);
 


getCollectionsFor

public CGenericFunctionCollection[] getCollectionsFor(String ident)
Returns all the generic function collections mapped to by ident.


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.