org.eclipse.ocl.examples.domain.values.impl
Class IntegerLongValueImpl
java.lang.Object
org.eclipse.ocl.examples.domain.values.impl.AbstractValue
org.eclipse.ocl.examples.domain.values.impl.AbstractIntegerValue
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.
Fields inherited from interface org.eclipse.ocl.examples.domain.values.Value |
INVALID_NAME |
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 |
IntegerLongValueImpl
public IntegerLongValueImpl(ValueFactory valueFactory,
long value)
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