org.eclipse.ocl.examples.domain.values.impl
Class IntegerLongValueImpl

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.impl.AbstractValue
      extended by org.eclipse.ocl.examples.domain.values.impl.AbstractIntegerValue
          extended by org.eclipse.ocl.examples.domain.values.impl.IntegerLongValueImpl
All Implemented Interfaces:
java.lang.Comparable<NumericValue>, IntegerValue, NumericValue, Value

public class IntegerLongValueImpl
extends AbstractIntegerValue

IntegerLongValueImpl provides an implementation of an IntegerValue using a Java long representation. Operations resulting in numeric growth may return IntegerValueImpl that uses BigInteger.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.IntegerValue
IntegerValue.Accumulator
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
valueFactory
 
Fields inherited from interface org.eclipse.ocl.examples.domain.values.Value
INVALID_NAME
 
Constructor Summary
IntegerLongValueImpl(ValueFactory valueFactory, long value)
           
 
Method Summary
 IntegerValue abs()
           
 IntegerValue add(IntegerValue right)
           
 java.lang.Double asDouble()
           
 java.lang.Integer asInteger()
           
 java.lang.Object asObject()
           
 java.math.BigDecimal bigDecimalValue()
           
 java.math.BigInteger bigIntegerValue()
           
 int compareTo(NumericValue o)
           
 IntegerValue div(IntegerValue right)
           
 RealValue divide(IntegerValue right)
           
 double doubleValue()
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 int intValue()
           
 boolean isUnlimitedNatural()
           
 long longValue()
           
 IntegerValue max(IntegerValue right)
           
 IntegerValue min(IntegerValue right)
           
 IntegerValue mod(IntegerValue right)
           
 IntegerValue multiply(IntegerValue right)
           
 IntegerValue negate()
           
 int signum()
           
 IntegerValue subtract(IntegerValue right)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractIntegerValue
asIntegerValue, asValidValue, getType, isIntegerValue, toIntegerValue, toRealValue
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asEcoreObject, asElement, asElementValue, asNavigableObject, asObjectValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getActualType, getValueFactory, isCollectionValue, isFalse, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, oclToString, toIteratorValue, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asEcoreObject, asElement, asElementValue, asNavigableObject, asObjectValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getActualType, getValueFactory, isCollectionValue, isFalse, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, oclToString, toIteratorValue, toString
 

Constructor Detail

IntegerLongValueImpl

public IntegerLongValueImpl(ValueFactory valueFactory,
                            long value)
Method Detail

abs

public IntegerValue abs()

add

public IntegerValue add(IntegerValue right)

asDouble

public java.lang.Double asDouble()
Specified by:
asDouble in interface Value
Overrides:
asDouble in class AbstractValue

asInteger

public java.lang.Integer asInteger()
                            throws InvalidValueException
Specified by:
asInteger in interface Value
Overrides:
asInteger in class AbstractValue
Throws:
InvalidValueException

asObject

public java.lang.Object asObject()

bigDecimalValue

public java.math.BigDecimal bigDecimalValue()

bigIntegerValue

public java.math.BigInteger bigIntegerValue()

compareTo

public int compareTo(NumericValue o)

div

public IntegerValue div(IntegerValue right)
                 throws InvalidValueException
Throws:
InvalidValueException

divide

public RealValue divide(IntegerValue right)
                 throws InvalidValueException
Throws:
InvalidValueException

doubleValue

public double doubleValue()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

intValue

public int intValue()
             throws InvalidValueException
Throws:
InvalidValueException

isUnlimitedNatural

public boolean isUnlimitedNatural()
Specified by:
isUnlimitedNatural in interface Value
Overrides:
isUnlimitedNatural in class AbstractValue

longValue

public long longValue()

max

public IntegerValue max(IntegerValue right)
                 throws InvalidValueException
Throws:
InvalidValueException

min

public IntegerValue min(IntegerValue right)
                 throws InvalidValueException
Throws:
InvalidValueException

mod

public IntegerValue mod(IntegerValue right)
                 throws InvalidValueException
Throws:
InvalidValueException

multiply

public IntegerValue multiply(IntegerValue right)
                      throws InvalidValueException
Throws:
InvalidValueException

negate

public IntegerValue negate()

signum

public int signum()

subtract

public IntegerValue subtract(IntegerValue right)
                      throws InvalidValueException
Throws:
InvalidValueException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object