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

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
                    |
                    +--de.tuberlin.cs.cis.ocl.eval.instance.IntegerInstance
All Implemented Interfaces:
Instance, OclAny, OclInteger, OclReal

public class IntegerInstance
extends RealInstance
implements OclInteger

Represents an instance of the OCL type Integer.

Author:
fchabar

Constructor Summary
IntegerInstance(int value)
          Constructs an instance of the OCL type Real via a Java int.
IntegerInstance(java.lang.Integer value)
          Constructs an instance of the OCL type Integer via a Java Integer.
 
Method Summary
 OclReal abs()
          Results in the absolute value of this instance.
 OclInteger div(OclInteger i2)
          Results in the number of times that i2 fits completely within this instance.
 OclReal division(OclInteger i2)
          Represents the operation '/'.
static int intValue(OclInteger i2)
          Determines the Java int representation of an OclInteger value.
 OclInteger max(OclInteger i2)
          Results in the maximum of this instance and i2.
 OclInteger min(OclInteger i2)
          Results in the minimum of this instance and i2.
 OclInteger minus(OclInteger i2)
          Represents the operation '-'.
 OclInteger mod(OclInteger i2)
          Results in this instance modulo i2.
 OclInteger multiplication(OclInteger i2)
          Represents the operation '*'.
 OclReal negation()
          Represents the prefix operation '-'.
 OclInteger plus(OclInteger i2)
          Represents the operation '+'.
 
Methods inherited from class de.tuberlin.cs.cis.ocl.eval.instance.RealInstance
division, doubleValue, equals, floor, less, lessOrEqual, max, min, minus, more, moreOrEqual, multiplication, plus, round
 
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.OclReal
division, floor, less, lessOrEqual, max, min, minus, more, moreOrEqual, multiplication, plus, round
 
Methods inherited from interface de.tuberlin.cs.cis.ocl.type.reflect.OclAny
eq, neq, oclAsType, oclInState, oclIsKindOf, oclIsNew, oclIsTypeOf
 

Constructor Detail

IntegerInstance

public IntegerInstance(java.lang.Integer value)
Constructs an instance of the OCL type Integer via a Java Integer.

Parameters:
value - a Java Integer.

IntegerInstance

public IntegerInstance(int value)
Constructs an instance of the OCL type Real via a Java int.

Parameters:
value - a Java int.
Method Detail

intValue

public static int intValue(OclInteger i2)
Determines the Java int representation of an OclInteger value.

Parameters:
i2 - an OclInteger value
Returns:
the Java int representation of the specified OCL Integer value.

plus

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

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

minus

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

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

multiplication

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

Specified by:
multiplication in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null).
Returns:
The value of the multiplication of this instance and i2.

div

public OclInteger div(OclInteger i2)
Description copied from interface: OclInteger
Results in the number of times that i2 fits completely within this instance. pre : i2 <> 0

Specified by:
div in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null)
Returns:
the number of times that i2 fits completely within this instance.

mod

public OclInteger mod(OclInteger i2)
Description copied from interface: OclInteger
Results in this instance modulo i2.

Specified by:
mod in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null)
Returns:
this instance modulo i2.

max

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

Specified by:
max in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null)
Returns:
the maximum of this instance and i2.

min

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

Specified by:
min in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null)
Returns:
the minimum of this instance and i2.

division

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

Specified by:
division in interface OclInteger
Parameters:
i2 - an instance of Integer (!= null).
Returns:
The value of the division of this instance by i2.

abs

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

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

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
Overrides:
negation in class RealInstance
Returns:
The negative value of self.