nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.datavector
Interface DataVector

All Known Implementing Classes:
DoubleArrayDataVector, InstanceDataVector, ListSetDataVector.LeftVector, ListSetDataVector.RightVector, MapDataVector, SparseListMapDataVector.LeftVector, SparseListMapDataVector.RightVector

public interface DataVector

Class describing an abstraction of a vector for data. This is designed so data does not need to be transformed, mearly wrapped, in order to use a single implementation of standard functions such as distance functions and aggregators. Note that this interface does not guarantee ordering or the consistant order of items.


Method Summary
 java.lang.Object getCurrentIndex()
          return the index at the current position of the iterator
 double getCurrentValue()
          return the value at the current position of the iterator.
 double getValue(java.lang.Object index)
          Get the value at the given index.
 boolean hasNext()
          Does the vector contain any additional non-zero values?
 void next()
          Move the iterator to the next non-zero index-value pair
 void reset()
          Reset the iterator to the first index of the function, potentially creating a new ordering of objects on some data vectors (i.e.
 void setSize(int s)
          Set the dimensionality of this vector
 int size()
          Returns the number of dimensions of this object.
 

Method Detail

size

int size()
Returns the number of dimensions of this object. This is frequently not the number of non-zero entries.

Returns:
dimension of the vector.

getValue

double getValue(java.lang.Object index)
Get the value at the given index. Note that this need not be an integer. Some classes require integer values and will throw an exception if the object does not convert into an integer.

Parameters:
index - index of the desired value
Returns:
value at the given index

reset

void reset()
Reset the iterator to the first index of the function, potentially creating a new ordering of objects on some data vectors (i.e. HashMap objects).


getCurrentValue

double getCurrentValue()
return the value at the current position of the iterator.

Returns:
current value

getCurrentIndex

java.lang.Object getCurrentIndex()
return the index at the current position of the iterator

Returns:

next

void next()
Move the iterator to the next non-zero index-value pair


hasNext

boolean hasNext()
Does the vector contain any additional non-zero values?

Returns:
are there values left.

setSize

void setSize(int s)
Set the dimensionality of this vector

Parameters:
s - dimensionality of the vector