Class PseudoReal
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.PseudoReal
-
- All Implemented Interfaces:
IVilType
- Direct Known Subclasses:
PseudoInteger
public class PseudoReal extends java.lang.Object implements IVilType
Implements a pseudo class for reals.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.DoubleDEFAULT
-
Constructor Summary
Constructors Modifier Constructor Description protectedPseudoReal()Prevents external instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleabs(double r0)Returns the absolute value of the given real value.static doubleadd(double r1, double r2)Represents the addition for reals.static intceil(double r0)Returns the integer that is closest to r0.static doubledivision(double r1, double r2)Represents the division for reals.static booleanequals(double r1, double r2)Represents the equality operation for Reals.static intfloor(double r0)Returns the largest integer that is less than or equal to r0.static TypeDescriptor<?>getType(java.lang.Double value)Returns the type ofvalue.static booleangreaterEqualThen(double r1, double r2)Represents the greater-then-equals comparison for reals.static booleangreaterThan(double r1, double r2)Represents the greater comparison for reals.static booleanisFinite(double r0)Returns whether the given real value is finite.static booleanisInfinite(double r0)Returns whether the given real value is infinite.static booleanisNaN(double r0)Returns whether the given real value is not a number.static booleanlessEqualThen(double r1, double r2)Represents the less-then-equals comparison for reals.static booleanlessThan(double r1, double r2)Represents the less-than comparison for reals.static doublemax(double r1, double r2)Returns the maximum value ofr1andr2.static doublemin(double r1, double r2)Returns the minimum value ofr1andr2.static doublemultiplication(double r1, double r2)Represents the multiplication for reals.static doublenegates(double r0)Negates the given real value.static doublesubtract(double r1, double r2)Represents the subtraction for reals.static java.lang.StringtoString(double r0)Returns the string value ofr0.static booleanunequals(double r1, double r2)Represents the unequality operation for Reals.
-
-
-
Method Detail
-
add
public static double add(double r1, double r2)Represents the addition for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 + r2
-
subtract
public static double subtract(double r1, double r2)Represents the subtraction for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 - r2
-
multiplication
public static double multiplication(double r1, double r2)Represents the multiplication for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 * r2
-
division
public static double division(double r1, double r2)Represents the division for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 / r2
-
lessThan
public static boolean lessThan(double r1, double r2)Represents the less-than comparison for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 < r2
-
lessEqualThen
public static boolean lessEqualThen(double r1, double r2)Represents the less-then-equals comparison for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 <= r2
-
greaterEqualThen
public static boolean greaterEqualThen(double r1, double r2)Represents the greater-then-equals comparison for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 >= r2
-
greaterThan
public static boolean greaterThan(double r1, double r2)Represents the greater comparison for reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 >= r2
-
equals
public static boolean equals(double r1, double r2)Represents the equality operation for Reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 == r2
-
unequals
public static boolean unequals(double r1, double r2)Represents the unequality operation for Reals.- Parameters:
r1- the first real to be consideredr2- the second real to be considered- Returns:
- r1 != r2
-
negates
public static double negates(double r0)
Negates the given real value.- Parameters:
r0- the real to be negated- Returns:
- -r0
-
abs
public static double abs(double r0)
Returns the absolute value of the given real value.- Parameters:
r0- the real the absolute value shall be returned for- Returns:
- |r0|
-
isNaN
public static boolean isNaN(double r0)
Returns whether the given real value is not a number.- Parameters:
r0- the real the absolute value to be considered- Returns:
trueifr0is not a number,falseelse
-
isFinite
public static boolean isFinite(double r0)
Returns whether the given real value is finite.- Parameters:
r0- the real the absolute value to be considered- Returns:
trueifr0is finite,falseelse
-
isInfinite
public static boolean isInfinite(double r0)
Returns whether the given real value is infinite.- Parameters:
r0- the real the absolute value to be considered- Returns:
trueifr0is infinite,falseelse
-
floor
public static int floor(double r0)
Returns the largest integer that is less than or equal to r0.- Parameters:
r0- the real value to be considered- Returns:
- floor(r0)
-
ceil
public static int ceil(double r0)
Returns the integer that is closest to r0.- Parameters:
r0- the real value to be considered- Returns:
- ceil(r0)
-
min
public static double min(double r1, double r2)Returns the minimum value ofr1andr2.- Parameters:
r1- the first value to be consideredr2- the first value to be considered- Returns:
- min(r1, r2)
-
max
public static double max(double r1, double r2)Returns the maximum value ofr1andr2.- Parameters:
r1- the first value to be consideredr2- the first value to be considered- Returns:
- max(r1, r2)
-
toString
public static java.lang.String toString(double r0)
Returns the string value ofr0.- Parameters:
r0- the real to be turned into a string- Returns:
- the string value
-
getType
public static TypeDescriptor<?> getType(java.lang.Double value)
Returns the type ofvalue. "Overrides"PseudoAny.getType(Object).- Parameters:
value- the Real to return the type for- Returns:
- the type of object (null if
obis null)
-
-