ru.sscc.util.data
Class DoublePointer
java.lang.Object
|
+--ru.sscc.util.data.RealPointer
|
+--ru.sscc.util.data.DoublePointer
- public final class DoublePointer
- extends RealPointer
An implementation of RealPointer based on double[]
type container.
|
Constructor Summary |
DoublePointer(double[] data)
Simple constructor (sets the pointer to the beginning of a data
container with a unit increment). |
DoublePointer(double[] data,
int index,
int step)
General constructor. |
|
Method Summary |
double |
add(double value)
Adds a value to the entry at the current pointer position. |
double |
get()
Gets an entry value at the current pointer position. |
double |
mul(double value)
Multiplies the entry at the current pointer position by a value. |
double |
set(double value)
Sets an entry value at the current pointer position. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DoublePointer
public DoublePointer(double[] data)
- Simple constructor (sets the pointer to the beginning of a data
container with a unit increment).
- Parameters:
data - a data container
DoublePointer
public DoublePointer(double[] data,
int index,
int step)
- General constructor.
- Parameters:
data - a data containerindex - a starting index in the containerstep - an increment step
get
public double get()
- Gets an entry value at the current pointer position.
- Overrides:
- get in class RealPointer
- Returns:
- value of the current entry
set
public double set(double value)
- Sets an entry value at the current pointer position.
- Overrides:
- set in class RealPointer
- Parameters:
value - a value to set- Returns:
- the set value
add
public double add(double value)
- Adds a value to the entry at the current pointer position.
- Overrides:
- add in class RealPointer
- Parameters:
value - a value to add- Returns:
- the result of addition
mul
public double mul(double value)
- Multiplies the entry at the current pointer position by a value.
- Overrides:
- mul in class RealPointer
- Parameters:
value - a value to multiply- Returns:
- the result of multiplication