|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.lib.OclAny
tudresden.ocl.lib.OclType
This class represents the predefined OCL class OclType and gives access to the meta level of OCL. Is is implemented as an adapter class around a java.lang.Class object.
Class
Field Summary | |
private Class |
myClass
the encapsulated Class object of this instance of OclType; for basic OCL types this is a class of this library, e.g. |
private String |
myName
the name of this OclType object, e.g. |
private static Map |
predefinedTypes
a Set containing all names of predefined OCL types |
static OclType |
typeAny
|
static OclType |
typeBoolean
|
static OclType |
typeInteger
singletons for the predefined types; can also be accessed through getOclTypeFor(String), which calls getPredefinedTypeFor(String) |
static OclType |
typeReal
|
static OclType |
typeString
|
static OclType |
typeType
|
Fields inherited from class tudresden.ocl.lib.OclAny |
|
Constructor Summary | |
protected |
OclType(Class c)
package-visible constructor for defined OclType objects |
|
OclType(int dummy,
String reason)
constructor for the undefined OclType object |
Method Summary | |
OclSet |
allInstances()
In general, it is not possible to get all instances of a class or type in Java. |
OclSet |
allSupertypes()
|
OclSet |
associationEnds()
|
OclSet |
attributes()
|
boolean |
equals(Object o)
|
OclRoot |
getFeature(String name)
This method returns an undefined value. |
static OclType |
getOclTypeFor(Object context,
String name)
factory method for OclTypes that creates OclType objects from its name; if the name does not contains a '.' character, package information is extracted from the object given as context
(should usually be called with this as context parameter);
if no class with the given name is found, this method
returns the undefined OclType object. |
static OclType |
getOclTypeFor(String name)
factory method for OclTypes that creates OclType objects from its fully qualified name; if no class with the given name is found, this method returns the undefined OclType object, |
protected static OclType |
getPredefinedTypeFor(String name)
|
int |
hashCode()
|
OclBoolean |
isEqualTo(Object o)
Returns true if this object is equal to the object given as parameter. |
OclString |
name()
|
OclBoolean |
oclIsKindOf(OclType type)
This method returns true if the OclType given as parameter is a type of the object whose method is called or a supertype of such a type. |
OclBoolean |
oclIsTypeOf(OclType type)
This method returns true if the OclType given as parameter is a "type" of this object. |
OclSet |
operations()
|
OclSet |
supertypes()
|
String |
toString()
|
Methods inherited from class tudresden.ocl.lib.OclAny |
getFeatureAsCollection, getUndefinedReason, isNotEqualTo, isUndefined, oclAsType, oclInState, oclType |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private Class myClass
private String myName
public static final OclType typeInteger
public static final OclType typeReal
public static final OclType typeString
public static final OclType typeBoolean
public static final OclType typeAny
public static final OclType typeType
private static final Map predefinedTypes
Constructor Detail |
protected OclType(Class c)
OclException
- if parameter c is null
public OclType(int dummy, String reason)
Method Detail |
public static OclType getOclTypeFor(String name)
name
- the name of the class that will be encapsulated by this
instance of OclType; the name needs to be fully qualified for
application types or be one of the names of the predefined OCL
types, e.g. "String" or "Integer"public static OclType getOclTypeFor(Object context, String name)
context
(should usually be called with this
as context parameter);
if no class with the given name is found, this method
returns the undefined OclType object.
name
- the name of the class that will be encapsulated by this
instance of OclType; the name needs to be fully qualified for
application types or be one of the names of the predefined OCL
types, e.g. "String" or "Integer"context
- package information is extracted from this object (the
class with the requested name will be assumed to be in the same
package as the context
object)protected static OclType getPredefinedTypeFor(String name)
public OclBoolean isEqualTo(Object o)
OclRoot
==
, not
equal
).
isEqualTo
in interface OclRoot
isEqualTo
in class OclAny
public boolean equals(Object o)
public int hashCode()
public String toString()
public OclRoot getFeature(String name)
getFeature
in interface OclRoot
getFeature
in class OclAny
public OclBoolean oclIsKindOf(OclType type)
OclAny
oclIsKindOf
in class OclAny
OclAny.oclIsKindOf(OclType type)
public OclBoolean oclIsTypeOf(OclType type)
OclAny
oclIsTypeOf
in class OclAny
public OclString name()
Class.getName()
public OclSet attributes()
public OclSet associationEnds()
Ocl.getPossibleAssociationNames()
.Ocl.getPossibleAssociationNames(String n)
public OclSet operations()
public OclSet supertypes()
public OclSet allSupertypes()
public OclSet allInstances()
Ocl.getAllInstances(OclType)
, which needs an implementation
of AllInstancesAdapter.
OclException
- if no AllInstancesAdapter is set in the class OclOcl.getAllInstances(OclType t)
,
AllInstancesAdapter
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |