de.tuberlin.cs.cis.ocl.eval.instance
Class RealInstance

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.eval.instance.PredefinedInstance
        |
        +--de.tuberlin.cs.cis.ocl.eval.instance.OclAnyInstance
              |
              +--de.tuberlin.cs.cis.ocl.eval.instance.RealInstance
All Implemented Interfaces:
Instance, OclAny, OclReal
Direct Known Subclasses:
IntegerInstance

public class RealInstance
extends OclAnyInstance
implements OclReal

Represents an instance of the OCL type Real.

Author:
fchabar

Constructor Summary
RealInstance(double number)
          Constructs an instance of the OCL type Real via a Java double.
RealInstance(java.lang.Double number)
          Constructs an instance of the OCL type Real via a Java Double.
 
Method Summary
 OclReal abs()
          Results in the absolute value of this instance.
 OclReal division(OclReal r2)
          Represents the operation '/'.
static double doubleValue(OclReal r2)
          Determines the Java double representation of an OclReal value.
 boolean equals(java.lang.Object o)
           
 OclInteger floor()
          Results in the largest integer which is less than or equal to r.
 OclBoolean less(OclReal r2)
          Returns True if this instance is less than r2.
 OclBoolean lessOrEqual(OclReal r2)
          Returns True if this instance is less than or equal than r2.
 OclReal max(OclReal r2)
          Results in the maximum of this instance and r2.
 OclReal min(OclReal r2)
          Results in the minimum of this instance and r2.
 OclReal minus(OclReal r2)
          Represents the operation '-'.
 OclBoolean more(OclReal r2)
          Returns True if this instance is greater than r2.
 OclBoolean moreOrEqual(OclReal r2)
          Returns True if this instance is greater or equal than r2.
 OclReal multiplication(OclReal r2)
          Represents the operation '*'.
 OclReal negation()
          Represents the prefix operation '-'.
 OclReal plus(OclReal r2)
          Represents the operation '+'.
 OclInteger round()
          Results in the integer that is closest to r.
 
Methods inherited from class de.tuberlin.cs.cis.ocl.eval.instance.OclAnyInstance
eq, neq, oclAsType, oclInState, oclIsKindOf, oclIsNew, oclIsTypeOf
 
Methods inherited from class de.tuberlin.cs.cis.ocl.eval.instance.PredefinedInstance
getRepresentation, getRuntimeType, getValue, hashCode, invoke, navigate, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.tuberlin.cs.cis.ocl.type.reflect.OclAny
eq, neq, oclAsType, oclInState, oclIsKindOf, oclIsNew, oclIsTypeOf
 

Constructor Detail

RealInstance

public RealInstance(java.lang.Double number)
Constructs an instance of the OCL type Real via a Java Double.


RealInstance

public RealInstance(double number)
Constructs an instance of the OCL type Real via a Java double.

Method Detail

doubleValue

public static double doubleValue(OclReal r2)
Determines the Java double representation of an OclReal value.

Parameters:
r2 - an OclReal value
Returns:
the Java double representation of the specified OCL Real value.

plus

public OclReal plus(OclReal r2)
Description copied from interface: OclReal
Represents the operation '+'. Results in the value of the addition of this instance and r2.

Specified by:
plus in interface OclReal
Parameters:
r2 - an instance of Real (!= null).
Returns:
The value of the addition of this instance and r2.

minus

public OclReal minus(OclReal r2)
Description copied from interface: OclReal
Represents the operation '-'. Results in the value of the substraction of this instance and r2.

Specified by:
minus in interface OclReal
Parameters:
r2 - an instance of Real (!= null).
Returns:
The value of the substraction of this instance and r2.

multiplication

public OclReal multiplication(OclReal r2)
Description copied from interface: OclReal
Represents the operation '*'. Results in the value of the multiplication of this instance and r2.

Specified by:
multiplication in interface OclReal
Parameters:
r2 - an instance of Real (!= null).
Returns:
The value of the multiplication of this instance and r2.

negation

public OclReal negation()
Description copied from interface: OclReal
Represents the prefix operation '-'. Results in the negative value of self.

Specified by:
negation in interface OclReal
Returns:
The negative value of self.

division

public OclReal division(OclReal r2)
Description copied from interface: OclReal
Represents the operation '/'. Results in the value of this instance divided by r2.

Specified by:
division in interface OclReal
Parameters:
r2 - an instance of Real (!= null).
Returns:
The value of the division of this instance by r2.

abs

public OclReal abs()
Description copied from interface: OclReal
Results in the absolute value of this instance.

Specified by:
abs in interface OclReal
Returns:
the absolute value of this instance.

floor

public OclInteger floor()
Description copied from interface: OclReal
Results in the largest integer which is less than or equal to r.

Specified by:
floor in interface OclReal
Returns:
the largest integer which is less than or equal to r.

round

public OclInteger round()
Description copied from interface: OclReal
Results in the integer that is closest to r. When there are two such integers, the largest one.

Specified by:
round in interface OclReal
Returns:
the integer that is closest to r

max

public OclReal max(OclReal r2)
Description copied from interface: OclReal
Results in the maximum of this instance and r2.

Specified by:
max in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
the maximum of this instance and r2.

min

public OclReal min(OclReal r2)
Description copied from interface: OclReal
Results in the minimum of this instance and r2.

Specified by:
min in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
the minimum of this instance and r2.

less

public OclBoolean less(OclReal r2)
Description copied from interface: OclReal
Returns True if this instance is less than r2.

Specified by:
less in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
True if this instance is less than r2, False otherwise.

more

public OclBoolean more(OclReal r2)
Description copied from interface: OclReal
Returns True if this instance is greater than r2.

Specified by:
more in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
True if this instance is greater than r2, False otherwise.

lessOrEqual

public OclBoolean lessOrEqual(OclReal r2)
Description copied from interface: OclReal
Returns True if this instance is less than or equal than r2.

Specified by:
lessOrEqual in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
True if this instance is less than or equal than r2, False otherwise.

moreOrEqual

public OclBoolean moreOrEqual(OclReal r2)
Description copied from interface: OclReal
Returns True if this instance is greater or equal than r2.

Specified by:
moreOrEqual in interface OclReal
Parameters:
r2 - an instance of Real (!= null)
Returns:
True if this instance is greater or equal than r2, False otherwise.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class OclAnyInstance