Dresden OCL Toolkit

tudresden.ocl.lib
Class OclAny

java.lang.Object
  extended bytudresden.ocl.lib.OclAny
All Implemented Interfaces:
Cloneable, OclRoot
Direct Known Subclasses:
OclAnyImpl, OclBoolean, OclReal, OclString, OclType

public abstract class OclAny
extends Object
implements OclRoot

This class represents the part of the OCL type OclAny common to basic types and application types, i.e. the availablity of certain properties.


Field Summary
private  String undefinedreason
          The reason, why this object represents an undefined value.
 
Constructor Summary
  OclAny()
           
protected OclAny(int dummy, String undefinedreason)
          Constructs an instance representing an undefined value.
 
Method Summary
abstract  OclRoot getFeature(String attributeName)
          This operation is implemented to access application object attributes in OclAnyImpl and to throw exceptions in the basic types.
 OclCollection getFeatureAsCollection(String name)
          Please consult the documentation of OclRoot.getFeatureAsCollection for a detailed explanation.
 String getUndefinedReason()
          Returns the reason, why this undefined ocl object has been created.
abstract  OclBoolean isEqualTo(Object o)
          Returns true if this object is equal to the object given as parameter.
 OclBoolean isNotEqualTo(Object o)
          Returns the negated result of isEqualTo.
 boolean isUndefined()
          Returns true if this object is the result of an undefined OCL expression.
 OclAny oclAsType(OclType t)
           
 OclBoolean oclInState(OclState state)
           
 OclBoolean oclIsKindOf(OclType t)
          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 t)
          This method returns true if the OclType given as parameter is a "type" of this object.
 OclType oclType()
          This property is no longer present in OCL 1.3.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

undefinedreason

private String undefinedreason
The reason, why this object represents an undefined value. Additionally, this is the tag, whether this object represents a undefined value. Is null, if and only if it is not undefined.

Constructor Detail

OclAny

public OclAny()

OclAny

protected OclAny(int dummy,
                 String undefinedreason)
Constructs an instance representing an undefined value.

Method Detail

isEqualTo

public abstract OclBoolean isEqualTo(Object o)
Description copied from interface: OclRoot
Returns true if this object is equal to the object given as parameter. For definitions of equality for the different types, see the implementing methods. Generally, all basic and collection objects are considered equal if they contain the same value(s), application objects are considered equal if they are identical (==, not equal).

Specified by:
isEqualTo in interface OclRoot

isNotEqualTo

public OclBoolean isNotEqualTo(Object o)
Description copied from interface: OclRoot
Returns the negated result of isEqualTo.

Specified by:
isNotEqualTo in interface OclRoot
Returns:
the negated result of isEqualTo
See Also:
OclRoot.isEqualTo(Object o)

oclIsKindOf

public OclBoolean oclIsKindOf(OclType t)
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.


oclIsTypeOf

public OclBoolean oclIsTypeOf(OclType t)
This method returns true if the OclType given as parameter is a "type" of this object. "Type" is to be understood in the UML/OCL sense of the word, meaning that a Java object has exactly one type (its class) and this types supertypes are not types of the object.


oclType

public OclType oclType()
This property is no longer present in OCL 1.3. In spite of this, the library contains this method. The problems that lead to its cancellation do not occur in this Java implementation.


oclAsType

public OclAny oclAsType(OclType t)

getFeature

public abstract OclRoot getFeature(String attributeName)
This operation is implemented to access application object attributes in OclAnyImpl and to throw exceptions in the basic types.

Specified by:
getFeature in interface OclRoot
Parameters:
attributeName - the name of the queried attribute
See Also:
OclCollection.collect(OclIterator iter, OclRootEvaluatable eval)

getFeatureAsCollection

public OclCollection getFeatureAsCollection(String name)
Please consult the documentation of OclRoot.getFeatureAsCollection for a detailed explanation.

Specified by:
getFeatureAsCollection in interface OclRoot
See Also:
OclRoot.getFeatureAsCollection(String name)

oclInState

public OclBoolean oclInState(OclState state)

isUndefined

public final boolean isUndefined()
Description copied from interface: OclRoot
Returns true if this object is the result of an undefined OCL expression.

Specified by:
isUndefined in interface OclRoot

getUndefinedReason

public final String getUndefinedReason()
Description copied from interface: OclRoot
Returns the reason, why this undefined ocl object has been created.

Specified by:
getUndefinedReason in interface OclRoot

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.