Package eu.simuline.relana.model
Class CClass
- java.lang.Object
-
- eu.simuline.relana.model.CClass
-
- All Implemented Interfaces:
CClassLink
public class CClass extends Object implements CClassLink
Represents a component class. Like a java-class this has a namecName, a packagepkgand a superclasssuperClasswhich is again aCClass. As this is a component class, it has named components and the mapping from names to components is given bysubComponents. Observe that the values are notCClasses butCClassLinks as the components may not be resolved if this class is resolved as a component may be again of thisCClass. **** Maps and effects **** are to be explained later.x- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCClass.SClassDeclstatic classCClass.SClassModifierEnumerates the class modifier for anSClass: input and output.
-
Field Summary
Fields Modifier and Type Field Description private StringcNameThe Name of thisCClass.static CClassCOMPONENTThe root of the subclass hierarchy ofCClasses: Class namedComponentwithout superclass, i.e.private Map<String,CClass.SClassDecl>effectsMaps the names of the effects to their classes.private Map<String,MapDecl>mapsThe maps declared in this class.private PackagepkgThe package of this class.private Map<String,CClassLink>subComponentsMaps the names of the subcomponents to their classes.private CClasssuperClassThe unique superclass of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOccurrence(CClassLoader.Occurrence occ)static CClassgetCClass(String cName, Package pkg, CClass superClass, Map<String,MapDecl> maps, Map<String,CClassLink> subComponents, Map<String,CClass.SClassDecl> effects)The location of the description of this class within the library.CClassLinkgetComponentCls(String name)CClassLinkgetComponentCls(List<String> path)(package private) Set<String>getComponentNames()CClass.SClassDeclgetEffectDecl(String name)CClass.SClassDeclgetEffectDecl(List<String> path)(package private) Set<String>getEffectNames()Set<CClass.SClassDecl>getEffectsRec()CInstancegetInstance()Returns an instance of this class.MapDeclgetMapDecl(String name)Returns the map declaration with the given name.StringgetName()Returns the short name of this class.private Map<String,CClassLink>getName2ComponentClss()Returns the map between names and subcomponent classes.private Map<String,CClass.SClassDecl>getName2Effects()PackagegetPackage()Returns the package of this class.CClassgetSuperClass()Returns the superclass of this class.booleanisResolved()CClassLinksetComponent(String name, CClass cClass)StringtoString()(package private) voidverify()
-
-
-
Field Detail
-
COMPONENT
public static final CClass COMPONENT
The root of the subclass hierarchy ofCClasses: Class namedComponentwithout superclass, i.e.getSuperClass()returnsnullThis represents an empty component.
-
cName
private final String cName
The Name of thisCClass.
-
pkg
private final Package pkg
The package of this class.
-
superClass
private final CClass superClass
The unique superclass of this class. There is exactly one class without super class:COMPONENTand the only one for which this field istnull.
-
subComponents
private final Map<String,CClassLink> subComponents
Maps the names of the subcomponents to their classes.
-
effects
private final Map<String,CClass.SClassDecl> effects
Maps the names of the effects to their classes.
-
-
Method Detail
-
getCClass
public static CClass getCClass(String cName, Package pkg, CClass superClass, Map<String,MapDecl> maps, Map<String,CClassLink> subComponents, Map<String,CClass.SClassDecl> effects)
The location of the description of this class within the library.
-
getName
public final String getName()
Returns the short name of this class.- Specified by:
getNamein interfaceCClassLink- Returns:
cName.
-
getSuperClass
public final CClass getSuperClass()
Returns the superclass of this class. This isnullif and only if this class is the unique overall base classCOMPONENT.- Returns:
superClass.
-
getMapDecl
public MapDecl getMapDecl(String name)
Returns the map declaration with the given name. The lookup is done recursively down the inheritance hierarchy.- Parameters:
name- the name of a declared map.- Returns:
- the map declaration with the given name
or
nullif no declaration is defined with this name.
-
getName2ComponentClss
private Map<String,CClassLink> getName2ComponentClss()
Returns the map between names and subcomponent classes.- Returns:
subComponents.
-
getComponentCls
public CClassLink getComponentCls(String name)
-
getComponentCls
public final CClassLink getComponentCls(List<String> path)
-
getEffectDecl
public CClass.SClassDecl getEffectDecl(String name)
-
getEffectDecl
public final CClass.SClassDecl getEffectDecl(List<String> path)
-
getName2Effects
private Map<String,CClass.SClassDecl> getName2Effects()
-
getEffectsRec
public final Set<CClass.SClassDecl> getEffectsRec()
-
setComponent
public final CClassLink setComponent(String name, CClass cClass)
- Specified by:
setComponentin interfaceCClassLink
-
verify
void verify() throws VerifyException- Throws:
VerifyException
-
getInstance
public CInstance getInstance()
Returns an instance of this class. Also resolves formulae.- Returns:
- a
CInstanceof this class.
-
addOccurrence
public void addOccurrence(CClassLoader.Occurrence occ)
- Specified by:
addOccurrencein interfaceCClassLink
-
isResolved
public final boolean isResolved()
- Specified by:
isResolvedin interfaceCClassLink
-
-