public class MeasuredValue
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
MeasuredValue(java.util.Collection<java.lang.Double> x,
Units units)
Calculates mean value and standard error from the given data.
|
MeasuredValue(double[] x,
Units units)
Calculates mean value and standard error from the given data.
|
MeasuredValue(double x,
double stdErr,
Units units)
If stdErr is unknown set it to 0.0.
|
Modifier and Type | Method and Description |
---|---|
MeasuredValue |
add(double a)
Returns a new MeasuredValue in which the value has number a added to it
but stdErr is unchanged.
|
MeasuredValue |
add(MeasuredValue x) |
MeasuredValue |
clone()
Returns a new MeasuredValue object with the same data.
|
MeasuredValue |
divide(MeasuredValue x) |
boolean |
equals(java.lang.Object other)
Tests for equality of value, sigma and units to 12 decimals.
|
double |
getStdErr()
Standard error, S.
|
Units |
getUnits() |
double |
getValue()
Value, x.
|
int |
hashCode() |
MeasuredValue |
multiply(double a)
Returns a new MeasuredValue in which both the value and the standard
error have been multiplied by number a.
|
MeasuredValue |
multiply(MeasuredValue x) |
double |
probablyEquals(java.lang.Object other)
Still experimental - Aims to returns probability of equality, from 0 to 1.
|
MeasuredValue |
subtract(MeasuredValue x) |
java.lang.String |
toString()
Outputs in the form "value +/- stdErr units" (but only "value units" if
stdErr is 0.0).
|
java.lang.String |
toString(java.text.DecimalFormat df)
Outputs in the form "value +/- sigma units" (but only "value units" if
sigma is 0.0).
|
public MeasuredValue(double x, double stdErr, Units units)
public MeasuredValue(double[] x, Units units)
public MeasuredValue(java.util.Collection<java.lang.Double> x, Units units)
public double getValue()
public double getStdErr()
public Units getUnits()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.text.DecimalFormat df)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public double probablyEquals(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public MeasuredValue clone()
clone
in class java.lang.Object
public MeasuredValue add(double a)
public MeasuredValue add(MeasuredValue x) throws MixedUnitsException
MixedUnitsException
public MeasuredValue subtract(MeasuredValue x) throws MixedUnitsException
MixedUnitsException
public MeasuredValue multiply(double a)
public MeasuredValue multiply(MeasuredValue x) throws MixedUnitsException
MixedUnitsException
public MeasuredValue divide(MeasuredValue x) throws MixedUnitsException
MixedUnitsException