|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.util.data.RealPointer
An abstract implementation of the sequential access to the vector distributed within a real data container by the regular manner (for example, with the fixed distance between neighbouring entries).
Field Summary | |
protected int |
index
An index of the current vector entry in the container. |
protected int |
step
An increment step - the distance between neighbouring vector entries. |
Constructor Summary | |
protected |
RealPointer(int index,
int step)
Constructs the pointer to the vector having the required starting index and increment step. |
Method Summary | |
abstract double |
add(double value)
Adds a value to the entry at the current pointer position. |
static RealPointer |
by(java.lang.Object obj)
Static service method which creates RealPointer upon an
object convertable to it (double[], float[],
RealContainer , RealVector , or RealPointer
instance). |
java.lang.Object |
clone()
Clones the pointer. |
abstract double |
get()
Gets an entry value at the current pointer position. |
RealPointer |
invert()
Inverts the pointer's direction (changes step sign). |
abstract double |
mul(double value)
Multiplies the entry at the current pointer position by a value. |
RealPointer |
next()
Moves pointer to the next vector entry (the same as shift(1) ). |
RealPointer |
previous()
Moves pointer to the previous vector entry (the same as shift(-1) ). |
RealPointer |
reset(int index,
int step)
Resets the pointer's position and increment to new values respective to the vector structure choosen when the pointer was constructed. |
void |
restore(long value)
Restores the pointer's index and step using a value saved in save operation. |
long |
save()
Packs the current pointer's index and step into long variable and returns it. |
abstract double |
set(double value)
Sets an entry value at the current pointer position. |
RealPointer |
shift(int count)
Moves pointer upto count vector entries. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int index
protected int step
Constructor Detail |
protected RealPointer(int index, int step)
index
- a starting index in the containerstep
- an increment stepMethod Detail |
public abstract double get()
public abstract double set(double value)
value
- a value to setpublic abstract double add(double value)
value
- a value to addpublic abstract double mul(double value)
value
- a value to addpublic final RealPointer next()
shift(1)
).public final RealPointer previous()
shift(-1)
).public final RealPointer shift(int count)
count
- a shift valuepublic final RealPointer invert()
public long save()
public void restore(long value)
value
- a value to restorepublic RealPointer reset(int index, int step)
index
- the new pointer position in the vectorstep
- the new increment step in the vectorpublic java.lang.Object clone()
public static RealPointer by(java.lang.Object obj)
RealPointer
upon an
object convertable to it (double[], float[],
RealContainer
, RealVector
, or RealPointer
instance). In the last case a clone of the pointer is created.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |