public class RealValueImpl extends NumberValueImpl implements RealValue
INVALID_NAME
Constructor and Description |
---|
RealValueImpl(java.math.BigDecimal value) |
RealValueImpl(double value) |
Modifier and Type | Method and Description |
---|---|
RealValue |
abs() |
RealValue |
addInteger(IntegerValue rightValue) |
RealValue |
addReal(RealValue rightValue) |
java.lang.Double |
asDouble() |
java.lang.Object |
asEcoreObject(IdResolver idResolver,
java.lang.Class<?> instanceClass)
Return the Ecore representation of this value, which should be fully compatible with the Ecore return
from a similarly typed eGet().
|
java.lang.Number |
asNumber() |
java.lang.Object |
asObject() |
RealValue |
asRealValue() |
java.lang.Object |
asUnboxedObject(IdResolver idResolver)
Return the unboxed representation of this value.
|
java.math.BigDecimal |
bigDecimalValue() |
java.math.BigInteger |
bigIntegerValue() |
RealValue |
commutatedAdd(RealValue left) |
int |
commutatedCompareTo(ComparableValue<?> left)
Return -left.compareTo(this).
|
int |
commutatedCompareToInteger(IntegerValue left) |
int |
commutatedCompareToReal(RealValue left) |
RealValue |
commutatedDivide(RealValue left) |
RealValue |
commutatedMultiply(RealValue left) |
RealValue |
commutatedSubtract(RealValue left) |
int |
compareTo(NumberValue right) |
protected static RealValue |
divideBigDecimal(java.math.BigDecimal left,
java.math.BigDecimal right) |
RealValue |
divideInteger(IntegerValue right) |
RealValue |
divideReal(RealValue right) |
double |
doubleValue() |
boolean |
equals(java.lang.Object obj) |
protected org.eclipse.emf.ecore.EClass |
eStaticClass() |
float |
floatValue() |
IntegerValue |
floor() |
protected java.lang.Object |
getIntegerValue() |
Type |
getType(StandardLibrary standardLibrary) |
TypeId |
getTypeId()
Return the type of this value determined from its construction context.
|
int |
hashCode() |
static void |
initStatics()
A simple public static method that may be used to force class initialization.
|
int |
intValue() |
IntegerValue |
isIntegerValue() |
UnlimitedNaturalValue |
isUnlimitedNaturalValue() |
long |
longValue() |
RealValue |
max(RealValue rightValue) |
RealValue |
maxInteger(IntegerValue rightValue) |
RealValue |
maxReal(RealValue rightValue) |
RealValue |
min(RealValue rightValue) |
RealValue |
minInteger(IntegerValue rightValue) |
RealValue |
minReal(RealValue rightValue) |
RealValue |
multiplyInteger(IntegerValue rightValue) |
RealValue |
multiplyReal(RealValue rightValue) |
RealValue |
negate() |
IntegerValue |
round() |
int |
signum() |
RealValue |
subtractInteger(IntegerValue rightValue) |
RealValue |
subtractReal(RealValue rightValue) |
java.lang.String |
toString() |
asBagValue, asCollectionValue, asElement, asInteger, asIntegerValue, asMapValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asSequenceValue, asSetValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, getTypeName, isInvalid, isUndefined, oclEquals, oclHashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asBagValue, asCollectionValue, asElement, asInteger, asIntegerValue, asMapValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asSequenceValue, asSetValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined, toString
oclEquals, oclHashCode
public RealValueImpl(double value)
public RealValueImpl(@NonNull java.math.BigDecimal value)
protected org.eclipse.emf.ecore.EClass eStaticClass()
eStaticClass
in class NumberValueImpl
@NonNull protected static RealValue divideBigDecimal(@NonNull java.math.BigDecimal left, @NonNull java.math.BigDecimal right)
public static void initStatics()
@NonNull public RealValue addInteger(@NonNull IntegerValue rightValue)
addInteger
in interface RealValue
@NonNull public java.lang.Double asDouble()
asDouble
in interface Value
asDouble
in class NumberValueImpl
public java.lang.Object asEcoreObject(@NonNull IdResolver idResolver, @Nullable java.lang.Class<?> instanceClass)
Value
A thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things, List<?> for collections
asEcoreObject
in interface Value
asEcoreObject
in class NumberValueImpl
@NonNull public RealValue asRealValue()
asRealValue
in interface Value
asRealValue
in class NumberValueImpl
@NonNull public java.lang.Object asUnboxedObject(@NonNull IdResolver idResolver)
Value
A thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things, Bag/Set/OrderedSet/List for collections
asUnboxedObject
in interface Value
@NonNull public java.math.BigDecimal bigDecimalValue()
bigDecimalValue
in interface RealValue
@NonNull public java.math.BigInteger bigIntegerValue()
bigIntegerValue
in interface RealValue
@NonNull public RealValue commutatedAdd(@NonNull RealValue left)
commutatedAdd
in interface RealValue
public int commutatedCompareTo(@NonNull ComparableValue<?> left)
ComparableValue
This is an internal method used to give righthand argument an opportunity to coerce its tyope to suit the lefthand. It is invoked when a direct compareTo is unable to compare left with this. Derived implementations must not invoke comoareTo in order to avoid an infinite commutation.
commutatedCompareTo
in interface ComparableValue<NumberValue>
public int commutatedCompareToInteger(@NonNull IntegerValue left)
commutatedCompareToInteger
in interface NumberValue
public int commutatedCompareToReal(@NonNull RealValue left)
commutatedCompareToReal
in interface NumberValue
@NonNull public RealValue commutatedDivide(@NonNull RealValue left)
commutatedDivide
in interface RealValue
@NonNull public RealValue commutatedMultiply(@NonNull RealValue left)
commutatedMultiply
in interface RealValue
@NonNull public RealValue commutatedSubtract(@NonNull RealValue left)
commutatedSubtract
in interface RealValue
public int compareTo(@Nullable NumberValue right)
compareTo
in interface java.lang.Comparable<NumberValue>
@NonNull public RealValue divideInteger(@NonNull IntegerValue right)
divideInteger
in interface RealValue
@NonNull public RealValue divideReal(@NonNull RealValue right)
divideReal
in interface RealValue
public double doubleValue()
doubleValue
in interface RealValue
doubleValue
in class java.lang.Number
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public float floatValue()
floatValue
in class java.lang.Number
@NonNull public IntegerValue floor()
protected java.lang.Object getIntegerValue()
@NonNull public Type getType(@NonNull StandardLibrary standardLibrary)
@NonNull public TypeId getTypeId()
Value
public int hashCode()
hashCode
in class java.lang.Object
public int intValue()
intValue
in class java.lang.Number
@Nullable public IntegerValue isIntegerValue()
isIntegerValue
in interface RealValue
@Nullable public UnlimitedNaturalValue isUnlimitedNaturalValue()
isUnlimitedNaturalValue
in interface NumberValue
public long longValue()
longValue
in class java.lang.Number
@NonNull public RealValue maxInteger(@NonNull IntegerValue rightValue)
maxInteger
in interface RealValue
@NonNull public RealValue minInteger(@NonNull IntegerValue rightValue)
minInteger
in interface RealValue
@NonNull public RealValue multiplyInteger(@NonNull IntegerValue rightValue)
multiplyInteger
in interface RealValue
@NonNull public RealValue multiplyReal(@NonNull RealValue rightValue)
multiplyReal
in interface RealValue
@NonNull public IntegerValue round()
@NonNull public RealValue subtractInteger(@NonNull IntegerValue rightValue)
subtractInteger
in interface RealValue
@NonNull public RealValue subtractReal(@NonNull RealValue rightValue)
subtractReal
in interface RealValue
public java.lang.String toString()
toString
in class java.lang.Object