de.uplanet.lucy.server.auxiliaries
Class MathUtil

java.lang.Object
  extended by de.uplanet.lucy.server.auxiliaries.MathUtil

@VelocityCallable(value="singleton")
public final class MathUtil
extends java.lang.Object

Version:
$Revision: 60098 $

Constructor Summary
MathUtil()
           
 
Method Summary
 double add(double p_dbl1, double p_dbl2)
           
 int add(int p_iA, int p_iB)
          Adds two int values.
 long add(long p_lA, long p_lB)
          Adds two long values.
 double add(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 double div(double p_dbl1, double p_dbl2)
           
 double div(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 boolean ge(double p_dbl1, double p_dbl2)
           
 boolean ge(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 int getRandomInt(int p_iMinValue, int p_iMaxValue)
           
 long getRandomLong(long p_lMinValue, long p_lMaxValue)
           
 boolean gt(double p_dbl1, double p_dbl2)
           
 boolean gt(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 boolean isInfinite(double p_dbl)
           
 boolean isInfinite(float p_flt)
           
 boolean isNaN(double p_dbl)
           
 boolean isNaN(float p_flt)
           
 boolean le(double p_dbl1, double p_dbl2)
           
 boolean le(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 boolean lt(double p_dbl1, double p_dbl2)
           
 boolean lt(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 double max(double p_dblA, double p_dblB)
           
 float max(float p_fA, float p_fB)
           
 int max(int p_iA, int p_iB)
           
 long max(long p_lA, long p_lB)
           
 double min(double p_dblA, double p_dblB)
           
 float min(float p_fA, float p_fB)
           
 int min(int p_iA, int p_iB)
           
 long min(long p_lA, long p_lB)
           
 double mult(double p_dbl1, double p_dbl2)
           
 int mult(int p_iA, int p_iB)
          Multiplies two int values.
 long mult(long p_lA, long p_lB)
          Multiplies two long values.
 double mult(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 double sub(double p_dbl1, double p_dbl2)
           
 int sub(int p_iA, int p_iB)
          Subtracts two int values.
 long sub(long p_lA, long p_lB)
          Subtracts two long values.
 double sub(java.lang.Number p_dbl1, java.lang.Number p_dbl2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathUtil

public MathUtil()
Method Detail

add

public int add(int p_iA,
               int p_iB)
Adds two int values. This method has no max int check.

Parameters:
p_iA - The first parameter.
p_iB - The second parameter.
Returns:
Returns int value p_iA + p_iB.

add

public long add(long p_lA,
                long p_lB)
Adds two long values. This method has no max long check.

Parameters:
p_lA - The first parameter.
p_lB - The second parameter.
Returns:
Returns long value p_lA + p_lB.

add

public double add(double p_dbl1,
                  double p_dbl2)

add

public double add(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

sub

public int sub(int p_iA,
               int p_iB)
Subtracts two int values. This method has no max or min int check.

Parameters:
p_iA - The first parameter.
p_iB - The second parameter.
Returns:
Returns int value p_iA - p_iB.

sub

public long sub(long p_lA,
                long p_lB)
Subtracts two long values. This method has no max or min long check.

Parameters:
p_lA - The first parameter.
p_lB - The second parameter.
Returns:
Returns long value p_lA - p_lB.

sub

public double sub(double p_dbl1,
                  double p_dbl2)

sub

public double sub(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

mult

public int mult(int p_iA,
                int p_iB)
Multiplies two int values. This method has no max int check.

Parameters:
p_iA - The first parameter.
p_iB - The second parameter.
Returns:
Returns a int value p_iA * p_iB. No range check.

mult

public long mult(long p_lA,
                 long p_lB)
Multiplies two long values. This method has no max long check.

Parameters:
p_lA - The first parameter.
p_lB - The second parameter.
Returns:
Returns a long value p_lA * p_lB.

mult

public double mult(double p_dbl1,
                   double p_dbl2)

mult

public double mult(java.lang.Number p_dbl1,
                   java.lang.Number p_dbl2)

div

public double div(double p_dbl1,
                  double p_dbl2)

div

public double div(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

isNaN

public boolean isNaN(float p_flt)

isInfinite

public boolean isInfinite(float p_flt)

isNaN

public boolean isNaN(double p_dbl)

isInfinite

public boolean isInfinite(double p_dbl)

min

public int min(int p_iA,
               int p_iB)

min

public long min(long p_lA,
                long p_lB)

min

public float min(float p_fA,
                 float p_fB)

min

public double min(double p_dblA,
                  double p_dblB)

max

public int max(int p_iA,
               int p_iB)

max

public long max(long p_lA,
                long p_lB)

max

public float max(float p_fA,
                 float p_fB)

max

public double max(double p_dblA,
                  double p_dblB)

gt

public boolean gt(double p_dbl1,
                  double p_dbl2)

gt

public boolean gt(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

ge

public boolean ge(double p_dbl1,
                  double p_dbl2)

ge

public boolean ge(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

lt

public boolean lt(double p_dbl1,
                  double p_dbl2)

lt

public boolean lt(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

le

public boolean le(double p_dbl1,
                  double p_dbl2)

le

public boolean le(java.lang.Number p_dbl1,
                  java.lang.Number p_dbl2)

getRandomInt

public int getRandomInt(int p_iMinValue,
                        int p_iMaxValue)
Parameters:
p_iMinValue - The inclusive minimum value.
p_iMaxValue - The exclusive maximum value.
Returns:
An integer random number r from the range p_iMinValue <= r < p_iMaxValue.
Throws:
java.lang.IllegalArgumentException - - If p_iMaxValue < p_iMinValue.

getRandomLong

public long getRandomLong(long p_lMinValue,
                          long p_lMaxValue)
Parameters:
p_lMinValue - The inclusive minimum value.
p_lMaxValue - The exclusive maximum value.
Returns:
An integer random number r from the range p_lMinValue <= r < p_lMaxValue.
Throws:
java.lang.IllegalArgumentException - - If p_lMaxValue < p_lMinValue.


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.