org.jscience.physics.nuclear.kinematics.math
Class UncertainNumber

java.lang.Object
  extended by org.jscience.physics.nuclear.kinematics.math.UncertainNumber
All Implemented Interfaces:
java.io.Serializable

public class UncertainNumber
extends java.lang.Object
implements java.io.Serializable

DOCUMENT ME!

See Also:
Serialized Form

Field Summary
 double error
          The uncertainty.
 double value
          The best estimate of the value.
 
Constructor Summary
UncertainNumber(double value)
          Constructor for a fixed value.
UncertainNumber(double value, double error)
          Constructor.
 
Method Summary
 UncertainNumber divide(double x)
          DOCUMENT ME!
 UncertainNumber divide(UncertainNumber x)
          DOCUMENT ME!
 boolean equals(java.lang.Object o)
          DOCUMENT ME!
 int hashcode()
          Override of hashcode to make sure that UncertainNumber's with the same value and error produce the same hashcode.
static void main(java.lang.String[] args)
          DOCUMENT ME!
 UncertainNumber minus(double x)
          DOCUMENT ME!
 UncertainNumber minus(UncertainNumber x)
          Subtract the given number from this number, propagating errors.
 UncertainNumber plus(UncertainNumber x)
          Add this number to the given number, propagating errors.
 java.lang.String plusMinusString()
          DOCUMENT ME!
 UncertainNumber times(double x)
          DOCUMENT ME!
 UncertainNumber times(UncertainNumber x)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public double value
The best estimate of the value.


error

public double error
The uncertainty.

Constructor Detail

UncertainNumber

public UncertainNumber(double value,
                       double error)
Constructor.

Parameters:
value - value of number
error - uncertainty in value

UncertainNumber

public UncertainNumber(double value)
Constructor for a fixed value.

Parameters:
value - value of number
Method Detail

plus

public UncertainNumber plus(UncertainNumber x)
Add this number to the given number, propagating errors.

Parameters:
x - number to add
Returns:
sum

minus

public UncertainNumber minus(UncertainNumber x)
Subtract the given number from this number, propagating errors.

Parameters:
x - number to subtract
Returns:
difference

minus

public UncertainNumber minus(double x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

times

public UncertainNumber times(UncertainNumber x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

times

public UncertainNumber times(double x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

divide

public UncertainNumber divide(UncertainNumber x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

divide

public UncertainNumber divide(double x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

plusMinusString

public java.lang.String plusMinusString()
DOCUMENT ME!

Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object o)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
o - DOCUMENT ME!
Returns:
true only if value and error are equal

hashcode

public int hashcode()
Override of hashcode to make sure that UncertainNumber's with the same value and error produce the same hashcode.

Returns:
the sum of hashcodes for Double objects containing this.value and this.error

main

public static void main(java.lang.String[] args)
DOCUMENT ME!

Parameters:
args - DOCUMENT ME!