org.grinvin.invariants.values

Class RealValue

Implemented Interfaces:
InvariantValue

public class RealValue
extends NumericValue

Invariant type which allows real values, including positive and negative infinity and undefined values. Identified by the string real.

Field Summary

Fields inherited from class org.grinvin.invariants.values.NumericValue

value

Constructor Summary

RealValue(double value, InvariantComputer computer)
Create an object of this type with the given value which is computed by the given computer.

Method Summary

static RealValue
negativeInfinity(InvariantComputer computer)
Return an object of this type representing negative infinity.
static RealValue
positiveInfinity(InvariantComputer computer)
Return an object of this type representing positive infinity.
String
toText()
static String
toText(double value)
Converts a real number to a value with internationalized names for 'undefined' and 'infinity'.
static RealValue
undefinedValue(InvariantComputer computer)
Return an object of this type representing an undefined value.

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

asDouble

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

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

Constructor Details

RealValue

public RealValue(double value,
                 InvariantComputer computer)
Create an object of this type with the given value which is computed by the given computer.

Method Details

negativeInfinity

public static RealValue negativeInfinity(InvariantComputer computer)
Return an object of this type representing negative infinity.
Parameters:
computer - Invariant computer which calculated this value.

positiveInfinity

public static RealValue positiveInfinity(InvariantComputer computer)
Return an object of this type representing positive infinity.
Parameters:
computer - Invariant computer which calculated this value.

toText

public String toText()
Specified by:
toText in interface InvariantValue
Overrides:
toText in interface AbstractInvariantValue

toText

public static String toText(double value)
Converts a real number to a value with internationalized names for 'undefined' and 'infinity'.

undefinedValue

public static RealValue undefinedValue(InvariantComputer computer)
Return an object of this type representing an undefined value.
Parameters:
computer - Invariant computer which calculated this value.