ru.sscc.util.data
Class SimplePointer
java.lang.Object
|
+--ru.sscc.util.data.RealPointer
|
+--ru.sscc.util.data.SimplePointer
- public final class SimplePointer
- extends RealPointer
An implementation of simple RealPointer
that every time
points to one double value stored in it. The clone operation
works for this pointer a bit different than for another pointers
(the cloned pointer will refer to the copy not to the same data).
Method Summary |
double |
add(double value)
Adds a value to the entry at the current pointer position. |
double |
get()
Gets an entry value. |
double |
mul(double value)
Multiplies the entry at the current pointer position by a value. |
double |
set(double value)
Sets an entry value. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
SimplePointer
public SimplePointer(double data)
- Constructor.
- Parameters:
data
- a data value to point
get
public double get()
- Gets an entry value.
- Overrides:
- get in class RealPointer
- Returns:
- value of the current entry
set
public double set(double value)
- Sets an entry value.
- 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