uk.ac.starlink.table.storage
Class ArrayPrimitiveStore

java.lang.Object
  |
  +--uk.ac.starlink.table.storage.ArrayPrimitiveStore
All Implemented Interfaces:
ValueStore

public class ArrayPrimitiveStore
extends Object
implements ValueStore

ValueStore implementation which stores primitive values in a normal java array.

Since:
1 Nov 2005

Constructor Summary
ArrayPrimitiveStore(Class clazz, int size)
          Constructs a new store.
 
Method Summary
 void get(long index, Object array)
          Retrieves a vector of values from this object.
 long getLength()
          Returns the length of the vector.
 Class getType()
          Returns the class of value which this object can store.
 void put(long index, Object array)
          Stores a vector of values in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayPrimitiveStore

public ArrayPrimitiveStore(Class clazz,
                           int size)
Constructs a new store. The supplied clazz must be a primitive type such as int.class.

Parameters:
clazz - primitive type to store
size - length of the vector
Method Detail

getType

public Class getType()
Description copied from interface: ValueStore
Returns the class of value which this object can store.

Specified by:
getType in interface ValueStore
Returns:
primitive class

getLength

public long getLength()
Description copied from interface: ValueStore
Returns the length of the vector.

Specified by:
getLength in interface ValueStore
Returns:
vector length

put

public void put(long index,
                Object array)
Description copied from interface: ValueStore
Stores a vector of values in this object. array must be an array of values matching getType. The first element of array is stored at index index, the second at index+1, etc.

Specified by:
put in interface ValueStore
Parameters:
index - starting offset
array - array of values to store

get

public void get(long index,
                Object array)
Description copied from interface: ValueStore
Retrieves a vector of values from this object. array must be an array of type matching getType. Every element of array will be filled with values; the first retrieved from offset index, the second from index+1, etc.

Specified by:
get in interface ValueStore
Parameters:
index - starting offset
array - array to accept data

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.