tudresden.ocl.check.types
Class Basic
java.lang.Object
tudresden.ocl.check.types.Basic
- All Implemented Interfaces:
- Any, Type
- public class Basic
- extends Object
- implements Any
Instances of this class are used to represent the OCL types
Integer, Real, Boolean, String, and Enumeration.
- Author:
- Frank Finger
Nested classes inherited from class tudresden.ocl.check.types.Any |
Any.VoidAny |
Fields inherited from interface tudresden.ocl.check.types.Any |
VOID |
Method Summary |
boolean |
conformsTo(Type t)
|
boolean |
hasState(String stateName)
|
static Type |
navigateAnyParameterized(String name,
Type[] params)
|
static Type |
navigateAnyQualified(String name,
Any any,
Type[] qualifiers)
|
protected Type |
navigateInteger(String name)
|
protected Type |
navigateInteger(String name,
Type[] params)
|
Type |
navigateParameterized(String name,
Type[] params)
Navigate to the result type of the operation name. |
Type |
navigateQualified(String name,
Type[] qualifiers)
navigate to the association end or attribute name, possibly with
qualifier types; unnamed association ends must by made available by
implementing methods with the name of the association end's type, but
beginning with a lower case character (see OCL specification for more
details) |
protected Type |
navigateReal(String name)
|
protected Type |
navigateReal(String name,
Type[] params)
|
protected Type |
navigateString(String name)
|
protected Type |
navigateString(String name,
Type[] params)
|
static String |
qualifierString(String name,
Type[] qualifiers)
|
static String |
signatureString(String name,
Type[] params)
Makes a nice string from a method signature or a qualified feature. |
static String |
stringOf(String name,
Type[] params,
char openBracket,
char closeBracket)
|
String |
toString()
|
static String |
typeString(Type t)
toString() returns "Integer" instead of "int",
which can't be distiguished from class Integer. |
INTEGER
public static final Basic INTEGER
REAL
public static final Basic REAL
BOOLEAN
public static final Basic BOOLEAN
STRING
public static final Basic STRING
ENUMERATION
public static final Basic ENUMERATION
OCLANY
public static final Basic OCLANY
name
protected String name
Basic
private Basic(String name)
navigateQualified
public Type navigateQualified(String name,
Type[] qualifiers)
- Description copied from interface:
Type
- navigate to the association end or attribute name, possibly with
qualifier types; unnamed association ends must by made available by
implementing methods with the name of the association end's type, but
beginning with a lower case character (see OCL specification for more
details)
- Specified by:
navigateQualified
in interface Type
- Parameters:
qualifiers
- the qualifier types; may (and will in most cases) be
null
, but never an array with length 0
navigateParameterized
public Type navigateParameterized(String name,
Type[] params)
- Description copied from interface:
Type
- Navigate to the result type of the operation name. This must return
a valid type whether the specified operation is a query or not.
Implement Type2
to check for query operations.
- Specified by:
navigateParameterized
in interface Type
- Parameters:
params
- the actual argument types
conformsTo
public boolean conformsTo(Type t)
- Specified by:
conformsTo
in interface Type
- Returns:
- true if an instance of the type represented by the called object
can replace an instance of the type given as parameter
hasState
public boolean hasState(String stateName)
- Specified by:
hasState
in interface Type
- Returns:
- true if this type has a state with the given name
toString
public String toString()
- Specified by:
toString
in interface Type
navigateReal
protected Type navigateReal(String name)
navigateReal
protected Type navigateReal(String name,
Type[] params)
navigateInteger
protected Type navigateInteger(String name)
navigateInteger
protected Type navigateInteger(String name,
Type[] params)
navigateString
protected Type navigateString(String name)
navigateString
protected Type navigateString(String name,
Type[] params)
navigateAnyQualified
public static Type navigateAnyQualified(String name,
Any any,
Type[] qualifiers)
navigateAnyParameterized
public static Type navigateAnyParameterized(String name,
Type[] params)
signatureString
public static String signatureString(String name,
Type[] params)
- Makes a nice string from a method signature or a qualified feature.
The result looks like Java source code.
qualifierString
public static String qualifierString(String name,
Type[] qualifiers)
stringOf
public static String stringOf(String name,
Type[] params,
char openBracket,
char closeBracket)
typeString
public static String typeString(Type t)
toString()
returns "Integer" instead of "int",
which can't be distiguished from class Integer.
Used for debugging output only.
Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.