public class DataDouble extends java.lang.Object implements IData, java.io.Serializable
All arithmetic methods throw ClassCastException if given a Data instance that is not of this type.
Modifier and Type | Class and Description |
---|---|
static class |
DataDouble.DataInfoDouble |
static class |
DataDouble.DataInfoDoubleFactory |
Modifier and Type | Field and Description |
---|---|
double |
x
The wrapped data value held by this object.
|
Constructor and Description |
---|
DataDouble()
Constructs a new instance with given descriptors.
|
Modifier and Type | Method and Description |
---|---|
void |
assignTo(double[] array)
Returns a new one-element array formed from the current value of this
instance.
|
void |
DE(double y)
Divide-equals (/=) operation.
|
void |
DE(IData y)
Divide-equals (/=) operation.
|
void |
E(double y)
Sets the wrapped double to the given value.
|
void |
E(IData y)
Sets the wrapped double to the value in the given instance.
|
int |
getLength()
Returns 1, indicating that this data object holds one value.
|
double |
getValue(int i)
Returns this instance's value if argument is 0, otherwise throw exception
|
boolean |
isNaN()
Returns true if the this instance's value is NaN.
|
void |
map(IFunction function)
Maps the function on this instance's value, replacing it with the value
returned by the function.
|
void |
ME(IData y)
Minus-equals (-=) operation.
|
void |
PE(double y)
Plus-equals (+=) operation.
|
void |
PE(IData y)
Plus-equals (+=) operation.
|
void |
TE(double y)
Times-equals (*=) operation.
|
void |
TE(IData y)
Times-equals (*=) operation.
|
java.lang.String |
toString()
Returns a string formed from the dataInfo label and this value.
|
public DataDouble()
label
- a phrase describing the datadimension
- the physical dimensions (e.g., mass, time) of the datapublic void E(IData y)
public void E(double y)
public void ME(IData y)
public void PE(IData y)
public void TE(IData y)
public void DE(IData y)
public void PE(double y)
public void TE(double y)
public void DE(double y)
public boolean isNaN()
public void map(IFunction function)
public void assignTo(double[] array)
public int getLength()
public double getValue(int i)
public java.lang.String toString()
toString
in class java.lang.Object