org.eclipse.xtext.xbase.lib
Class DoubleExtensions

java.lang.Object
  extended by org.eclipse.xtext.xbase.lib.DoubleExtensions

public class DoubleExtensions
extends java.lang.Object

This is an extension library for floating point numbers, e.g. double or Double.

Author:
Jan Koehnlein - Initial contribution and API

Constructor Summary
DoubleExtensions()
           
 
Method Summary
static double operator_divide(double a, double b)
          The binary divide operator.
static double operator_divide(java.lang.Double a, java.lang.Number b)
          The binary divide operator.
static boolean operator_equals(double a, double b)
          The binary equals operator.
static boolean operator_greaterEqualsThan(double a, double b)
          The binary greater than or equals operator.
static boolean operator_greaterThan(double a, double b)
          The binary greater than operator.
static boolean operator_lessEqualsThan(double a, double b)
          The binary less than or equals operator.
static boolean operator_lessThan(double a, double b)
          The binary less than operator.
static double operator_minus(double a)
          The unary minus operator.
static double operator_minus(java.lang.Double a)
          The unary minus operator.
static double operator_minus(double a, double b)
          The binary minus operator.
static double operator_minus(java.lang.Double a, java.lang.Number b)
          The binary minus operator.
static double operator_multiply(double a, double b)
          The binary times operator.
static double operator_multiply(java.lang.Double a, java.lang.Number b)
          The binary times operator.
static boolean operator_notEquals(double a, double b)
          The binary not equals operator.
static double operator_plus(double a, double b)
          The binary plus operator.
static double operator_plus(java.lang.Double a, java.lang.Number b)
          The binary plus operator.
static double operator_power(double a, double b)
          The power operator.
static double operator_power(java.lang.Double a, java.lang.Number b)
          The power operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleExtensions

public DoubleExtensions()
Method Detail

operator_minus

public static double operator_minus(double a)
The unary minus operator. This is the equivalent to the unary java - operator.

Parameters:
a - a double.
Returns:
-a

operator_minus

public static double operator_minus(java.lang.Double a)
The unary minus operator. This is the equivalent to the unary java - operator.

Parameters:
a - a double. May not be null.
Returns:
-a
Throws:
java.lang.NullPointerException - if a is null.

operator_plus

public static double operator_plus(double a,
                                   double b)
The binary plus operator. This is the equivalent to the java + operator.

Parameters:
a - a double.
b - a double.
Returns:
a+b

operator_plus

public static double operator_plus(java.lang.Double a,
                                   java.lang.Number b)
The binary plus operator. This is the equivalent to the java + operator.

Parameters:
a - a double. May not be null.
b - a number. May not be null.
Returns:
a+b
Throws:
java.lang.NullPointerException - if a or b is null.

operator_minus

public static double operator_minus(double a,
                                    double b)
The binary minus operator. This is the equivalent to the java - operator.

Parameters:
a - a double.
b - a double.
Returns:
a-b

operator_minus

public static double operator_minus(java.lang.Double a,
                                    java.lang.Number b)
The binary minus operator. This is the equivalent to the java - operator.

Parameters:
a - a double. May not be null.
b - a number. May not be null.
Returns:
a-b
Throws:
java.lang.NullPointerException - if a or b is null.

operator_power

public static double operator_power(double a,
                                    double b)
The power operator.

Parameters:
a - a double.
b - a double.
Returns:
a ** b

operator_power

public static double operator_power(java.lang.Double a,
                                    java.lang.Number b)
The power operator.

Parameters:
a - a double. May not be null.
b - a number. May not be null.
Returns:
a ** b
Throws:
java.lang.NullPointerException - if a or b is null.

operator_multiply

public static double operator_multiply(double a,
                                       double b)
The binary times operator. This is the equivalent to the java * operator.

Parameters:
a - a double.
b - a double.
Returns:
a*b

operator_multiply

public static double operator_multiply(java.lang.Double a,
                                       java.lang.Number b)
The binary times operator. This is the equivalent to the java * operator.

Parameters:
a - a double. May not be null.
b - a number. May not be null.
Returns:
a*b
Throws:
java.lang.NullPointerException - if a or b is null.

operator_divide

public static double operator_divide(double a,
                                     double b)
The binary divide operator. This is the equivalent to the java / operator. That is, the result will be the integral result of the division, e.g. operator_divide(1, 2) yields 0 .

Parameters:
a - a double.
b - a double.
Returns:
a/b

operator_divide

public static double operator_divide(java.lang.Double a,
                                     java.lang.Number b)
The binary divide operator. This is the equivalent to the java / operator. That is, the result will be the integral result of the division, e.g. operator_divide(1, 2) yields 0 .

Parameters:
a - a double. May not be null.
b - a number. May not be null.
Returns:
a/b
Throws:
java.lang.NullPointerException - if a or b is null.

operator_equals

public static boolean operator_equals(double a,
                                      double b)
The binary equals operator. This is the equivalent to the java == operator.

Parameters:
a - a double.
b - a double.
Returns:
a==b

operator_notEquals

public static boolean operator_notEquals(double a,
                                         double b)
The binary not equals operator. This is the equivalent to the java != operator.

Parameters:
a - a double.
b - a double.
Returns:
a!=b

operator_lessThan

public static boolean operator_lessThan(double a,
                                        double b)
The binary less than operator. This is the equivalent to the java < operator.

Parameters:
a - a double.
b - a double.
Returns:
a<b

operator_lessEqualsThan

public static boolean operator_lessEqualsThan(double a,
                                              double b)
The binary less than or equals operator. This is the equivalent to the java <= operator.

Parameters:
a - a double.
b - a double.
Returns:
a<=b

operator_greaterThan

public static boolean operator_greaterThan(double a,
                                           double b)
The binary greater than operator. This is the equivalent to the java > operator.

Parameters:
a - a double.
b - a double.
Returns:
a>b

operator_greaterEqualsThan

public static boolean operator_greaterEqualsThan(double a,
                                                 double b)
The binary greater than or equals operator. This is the equivalent to the java >= operator.

Parameters:
a - a double.
b - a double.
Returns:
a>=b