Dresden OCL Toolkit

tudresden.ocl.lib
Class OclBoolean

java.lang.Object
  extended bytudresden.ocl.lib.OclAny
      extended bytudresden.ocl.lib.OclBoolean
All Implemented Interfaces:
Cloneable, OclRoot

public class OclBoolean
extends OclAny

A class that represents the basic OCL type Boolean. There is no public constructor for this class to enforce that exactly two instances of this class exist: TRUE and FALSE. This is a slightly weakened Singleton pattern.

TRUE and FALSE (in capital letters) in this documentation page denote the class attributes of the same name.

Author:
Frank Finger

Field Summary
private  boolean bValue
           
static OclBoolean FALSE
          The instance of this class that represents the boolean value false.
static OclBoolean TRUE
          The instance of this class that represents the boolean value true.
 
Fields inherited from class tudresden.ocl.lib.OclAny
 
Constructor Summary
private OclBoolean(boolean b)
          constructor for defined values
  OclBoolean(int dummy, String undefinedreason)
          constructor for undefined value
 
Method Summary
 OclBoolean and(OclBoolean b)
           
 OclRoot getFeature(String name)
          This method returns an undefined value.
 OclRoot ifThenElse(OclRoot param1, OclRoot param2)
           
 OclBoolean implies(OclBoolean b)
           
 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 isTrue()
           
 OclBoolean not()
           
 OclType oclType()
          This property is no longer present in OCL 1.3.
 OclBoolean or(OclBoolean b)
           
 String toString()
           
 OclBoolean xor(OclBoolean b)
           
 
Methods inherited from class tudresden.ocl.lib.OclAny
getFeatureAsCollection, getUndefinedReason, isUndefined, oclAsType, oclInState, oclIsKindOf, oclIsTypeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FALSE

public static final OclBoolean FALSE
The instance of this class that represents the boolean value false.


TRUE

public static final OclBoolean TRUE
The instance of this class that represents the boolean value true.


bValue

private boolean bValue
Constructor Detail

OclBoolean

public OclBoolean(int dummy,
                  String undefinedreason)
constructor for undefined value


OclBoolean

private OclBoolean(boolean b)
constructor for defined values

Method Detail

isEqualTo

public 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
Specified by:
isEqualTo in class OclAny
Returns:
TRUE if the called object and the parameter are identical

isNotEqualTo

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

Specified by:
isNotEqualTo in interface OclRoot
Overrides:
isNotEqualTo in class OclAny
Returns:
the negateted result of isEqualTo
See Also:
isEqualTo(Object o)

xor

public OclBoolean xor(OclBoolean b)
Returns:
TRUE if this object is different from the one given as parameter

or

public OclBoolean or(OclBoolean b)
Returns:
TRUE if this object, the operations parameter or both are TRUE, FALSE otherwise

and

public OclBoolean and(OclBoolean b)
Returns:
TRUE if this object and the operations parameter are TRUE, FALSE otherwise

not

public OclBoolean not()
Returns:
TRUE if this object is FALSE, FALSE otherwise

implies

public OclBoolean implies(OclBoolean b)
Returns:
FALSE if this object is TRUE and the parameter of the operation is FALSE, TRUE otherwise

ifThenElse

public OclRoot ifThenElse(OclRoot param1,
                          OclRoot param2)
Returns:
param1 if this OclBoolean is true, param2 otherwise; usually it's preferrable to use Javas "?:" operator since that is type preserving

isTrue

public boolean isTrue()
Returns:
true if this object is TRUE, false otherwise

getFeature

public OclRoot getFeature(String name)
This method returns an undefined value.

Specified by:
getFeature in interface OclRoot
Specified by:
getFeature in class OclAny

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.

Overrides:
oclType in class OclAny

toString

public String toString()

Dresden OCL Toolkit

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