edu.unh.sdb.common
Class Values

java.lang.Object
  extended by edu.unh.sdb.common.Values
Direct Known Subclasses:
ByteValues, DoubleValues, FloatValues, IntValues, MixedValues, ShortValues

public abstract class Values
extends java.lang.Object


Constructor Summary
Values()
           
 
Method Summary
abstract  byte getByte(int index)
           
abstract  byte[] getBytes()
          Return a byte array representing all elements in the Values object
 byte[] getBytes(byte[] filler)
          Fill byte array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned.
 byte[] getBytes(int start, int stride)
          Return byte array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.
 byte[] getBytes(int start, int stride, byte[] fill)
          Reference version of getBytes( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 byte[] getBytes(int start, int stride, int num)
          Return byte array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument).
 byte[] getBytes(int start, int stride, int num, byte[] fill)
          Reference version of getBytes( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
abstract  double getDouble(int index)
           
abstract  double[] getDoubles()
          Return double array representing all elements in the Values object
 double[] getDoubles(double[] filler)
          Fill double array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned.
 double[] getDoubles(int start, int stride)
          Return double array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.
 double[] getDoubles(int start, int stride, double[] fill)
          Reference version of getDoubles( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 double[] getDoubles(int start, int stride, int num)
          Return double array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument).
 double[] getDoubles(int start, int stride, int num, double[] fill)
          Reference version of getDoubles( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
abstract  float getFloat(int index)
           
abstract  float[] getFloats()
          Return float array representing all elements in the Values object
 float[] getFloats(float[] filler)
          Fill float array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned.
 float[] getFloats(int start, int stride)
          Return float array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.
 float[] getFloats(int start, int stride, float[] fill)
          Reference version of getFloats( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 float[] getFloats(int start, int stride, int num)
          Return floats array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument).
 float[] getFloats(int start, int stride, int num, float[] fill)
          Reference version of getFloats( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
abstract  int getInt(int index)
           
abstract  int[] getInts()
          Return int array representing all elements in the Values object
 int[] getInts(int[] filler)
          Fill int array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned.
 int[] getInts(int start, int stride)
          Return int array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.
 int[] getInts(int start, int stride, int num)
          Return int array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument).
 int[] getInts(int start, int stride, int[] fill)
          Reference version of getInts( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 int[] getInts(int start, int stride, int num, int[] fill)
          Reference version of getInts( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
abstract  short getShort(int index)
           
abstract  short[] getShorts()
          Return a short array representing all elements in the Values object
 short[] getShorts(int start, int stride)
          Return short array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.
 short[] getShorts(int start, int num, int stride)
          Return short array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument).
 short[] getShorts(int start, int stride, int num, short[] fill)
          Reference version of getShorts( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 short[] getShorts(int start, int stride, short[] fill)
          Reference version of getShorts( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.
 short[] getShorts(short[] filler)
          Fill short array representing all elements in the Values object If the passed array is not the right size, an warning is issued and a correct size array is allocated and returned.
abstract  int getStorageType()
           
static void main(java.lang.String[] args)
           
abstract  Values reorder(int step)
          Return a new Values object with the values shuffled.
abstract  void setByte(int index, byte val)
           
abstract  void setDouble(int index, double val)
           
abstract  void setFloat(int index, float val)
           
abstract  void setInt(int index, int val)
           
abstract  void setShort(int index, short val)
           
abstract  void setValues(int start, Values newVal)
          Assign elements of the passed in Values object to this one beginning at the start index .
abstract  void setValues(Values newVal)
          Assign the data from the argument Values object to this object.
abstract  int size()
           
abstract  Values spawn()
          create a new copy of this Values class, but NO data is copied
 Values spawn(int start, int stride)
          Create a new instance of ShortValues with a subsest of the data in this object.
abstract  Values spawn(int start, int stride, int count)
          create a new instance of this Values class; copy a subset of the data to new.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Values

public Values()
Method Detail

getDouble

public abstract double getDouble(int index)

getFloat

public abstract float getFloat(int index)

getInt

public abstract int getInt(int index)

getShort

public abstract short getShort(int index)

getByte

public abstract byte getByte(int index)

setDouble

public abstract void setDouble(int index,
                               double val)

setFloat

public abstract void setFloat(int index,
                              float val)

setInt

public abstract void setInt(int index,
                            int val)

setShort

public abstract void setShort(int index,
                              short val)

setByte

public abstract void setByte(int index,
                             byte val)

size

public abstract int size()

getStorageType

public abstract int getStorageType()

spawn

public abstract Values spawn()
create a new copy of this Values class, but NO data is copied


spawn

public abstract Values spawn(int start,
                             int stride,
                             int count)
create a new instance of this Values class; copy a subset of the data to new.


spawn

public Values spawn(int start,
                    int stride)
Create a new instance of ShortValues with a subsest of the data in this object. Subsets can be contiguous or can have a stride as is done in point order storage. The new instance will copy all data from the existing object as defined by the stride.

Parameters:
start - - first value to copy
stride - - steps between values

reorder

public abstract Values reorder(int step)
Return a new Values object with the values shuffled. This method starts at positions 0 through step-1, copying every "step" values to the new array. This has the effect of converting an attribute ordered array to a point ordered array or vice versa. The Values object does not actually need to know the axisOrdering, the conversion is the same.


setValues

public abstract void setValues(Values newVal)
Assign the data from the argument Values object to this object. This object will now have a new data size that is the same as the arguments. (This version clones the data; do we want to just reference it?)


setValues

public abstract void setValues(int start,
                               Values newVal)
Assign elements of the passed in Values object to this one beginning at the start index . Do conversions as needed. If the argument size is less than is available beginning at the start position, only the remaining values will be changed.


getDoubles

public abstract double[] getDoubles()
Return double array representing all elements in the Values object


getFloats

public abstract float[] getFloats()
Return float array representing all elements in the Values object


getInts

public abstract int[] getInts()
Return int array representing all elements in the Values object


getShorts

public abstract short[] getShorts()
Return a short array representing all elements in the Values object


getBytes

public abstract byte[] getBytes()
Return a byte array representing all elements in the Values object


getDoubles

public double[] getDoubles(double[] filler)
Fill double array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned. This is should be overridden by children -- it allocates and copies.


getFloats

public float[] getFloats(float[] filler)
Fill float array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned. This is should be overridden by children -- it allocates and copies.


getInts

public int[] getInts(int[] filler)
Fill int array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned. This is should be overridden by children -- it allocates and copies.


getShorts

public short[] getShorts(short[] filler)
Fill short array representing all elements in the Values object If the passed array is not the right size, an warning is issued and a correct size array is allocated and returned. This is should be overridden by children -- it allocates and copies.


getBytes

public byte[] getBytes(byte[] filler)
Fill byte array representing all elements in the Values object If the passed array is not the right size, a a correct size array is allocated and returned. This is should be overridden by children -- it allocates and copies.


getDoubles

public double[] getDoubles(int start,
                           int stride)
Return double array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.


getDoubles

public double[] getDoubles(int start,
                           int stride,
                           double[] fill)
Reference version of getDoubles( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getFloats

public float[] getFloats(int start,
                         int stride)
Return float array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.


getFloats

public float[] getFloats(int start,
                         int stride,
                         float[] fill)
Reference version of getFloats( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getInts

public int[] getInts(int start,
                     int stride)
Return int array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.


getInts

public int[] getInts(int start,
                     int stride,
                     int[] fill)
Reference version of getInts( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getShorts

public short[] getShorts(int start,
                         int stride)
Return short array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.


getShorts

public short[] getShorts(int start,
                         int stride,
                         short[] fill)
Reference version of getShorts( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getBytes

public byte[] getBytes(int start,
                       int stride)
Return byte array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until we get to the end of the array.


getBytes

public byte[] getBytes(int start,
                       int stride,
                       byte[] fill)
Reference version of getBytes( start, stride ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getDoubles

public double[] getDoubles(int start,
                           int stride,
                           int num)
Return double array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument). If there are not enough elements in the Values object to satisfy the request, the returned array will have only as many values as could be found given the start and stride arguments.


getFloats

public float[] getFloats(int start,
                         int stride,
                         int num)
Return floats array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument). If there are not enough elements in the Values object to satisfy the request, the returned array will have only as many values as could be found given the start and stride arguments.


getInts

public int[] getInts(int start,
                     int stride,
                     int num)
Return int array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument). If there are not enough elements in the Values object to satisfy the request, the returned array will have only as many values as could be found given the start and stride arguments.


getShorts

public short[] getShorts(int start,
                         int num,
                         int stride)
Return short array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument). If there are not enough elements in the Values object to satisfy the request, the returned array will have only as many values as could be found given the start and stride arguments.


getBytes

public byte[] getBytes(int start,
                       int stride,
                       int num)
Return byte array representing a subset of elements in the Values object Copying starts at the index specified by the start argument, the 2nd item copied will be at index start + stride where stride is the second argument; the 3rd is at start + 2*stride and so forth until the specified number of values have been copied (3rd argument). If there are not enough elements in the Values object to satisfy the request, the returned array will have only as many values as could be found given the start and stride arguments.


getDoubles

public double[] getDoubles(int start,
                           int stride,
                           int num,
                           double[] fill)
Reference version of getDoubles( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getFloats

public float[] getFloats(int start,
                         int stride,
                         int num,
                         float[] fill)
Reference version of getFloats( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getInts

public int[] getInts(int start,
                     int stride,
                     int num,
                     int[] fill)
Reference version of getInts( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getShorts

public short[] getShorts(int start,
                         int stride,
                         int num,
                         short[] fill)
Reference version of getShorts( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


getBytes

public byte[] getBytes(int start,
                       int stride,
                       int num,
                       byte[] fill)
Reference version of getBytes( start, stride, num ) The passed array is returned for convenience, but if it is not the right size, a new array is allocated and returned.


main

public static void main(java.lang.String[] args)