ru.sscc.util.data
Class RealPointers

java.lang.Object
  |
  +--ru.sscc.util.data.RealPointer
        |
        +--ru.sscc.util.data.RealPointers

public final class RealPointers
extends RealPointer

An implementation of RealPointer based on RealVectors type container. Every vector occupies a continuous part of the container. The vectors array is logically presented by this pointer as a continuous array consisting of vectors ordered by their natural order (inspite their representation in the container). So, moving the pointer up, you will access to the components of 0th vector, then 1st vector, then 2nd vector and so on. You can also directly select a vector to point using the select operation.


Fields inherited from class ru.sscc.util.data.RealPointer
index, step
 
Constructor Summary
RealPointers(RealVectors vectors)
          Constructor.
 
Method Summary
 double add(double value)
          Adds a value to the entry at the current pointer position.
 java.lang.Object clone()
          Clones the pointer.
 double get()
          Gets an entry value at the current pointer position.
 RealVectors getVectors()
          Returns vectors container pointed.
 double mul(double value)
          Multiplies the entry at the current pointer position by a value.
 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.
 void select(int i)
          Selects i-th vector and resets the pointer to the beginning of the selected vector.
 double set(double value)
          Sets an entry value at the current pointer position.
 
Methods inherited from class ru.sscc.util.data.RealPointer
by, invert, next, previous, shift
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealPointers

public RealPointers(RealVectors vectors)
Constructor.
Parameters:
vectors - a vectors container
Method Detail

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

getVectors

public RealVectors getVectors()
Returns vectors container pointed.

select

public void select(int i)
Selects i-th vector and resets the pointer to the beginning of the selected vector.

save

public long save()
Packs the current pointer's index and step into long variable and returns it.
Overrides:
save in class RealPointer
Returns:
packed index and step

restore

public void restore(long value)
Restores the pointer's index and step using a value saved in save operation.
Overrides:
restore in class RealPointer
Parameters:
value - a value to restore

reset

public 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.
Overrides:
reset in class RealPointer
Parameters:
index - the new pointer position in the vector
step - the new increment step in the vector
Returns:
the resetted pointer

clone

public java.lang.Object clone()
Clones the pointer.
Overrides:
clone in class RealPointer
Returns:
clone of this pointer