org.grinvin.invariants.values

Class NumericValue

Implemented Interfaces:
InvariantValue
Known Direct Subclasses:
IntegerValue, RealValue

public abstract class NumericValue
extends AbstractInvariantValue

Common superclass of IntegerValue and RealValue.

Field Summary

protected double
value
Internal representation of the actual value.

Constructor Summary

NumericValue(double value, InvariantType type, InvariantComputer computer)

Method Summary

double
asDouble()
Return the actual value as a real number.

Methods inherited from class org.grinvin.invariants.values.AbstractInvariantValue

String toString, getComputerId, getComputerVersion, getInvariant, getType, toText

Field Details

value

protected double value
Internal representation of the actual value. This is a double, allowing the representation of infinity and undefined (as 'not a number'), also when representing integers.

Constructor Details

NumericValue

protected NumericValue(double value,
                       InvariantType type,
                       InvariantComputer computer)

Method Details

asDouble

public double asDouble()
Return the actual value as a real number. An undefined value is represented by Double.NaN.