Package uk.ac.starlink.table.storage
Class ArrayPrimitiveStore
java.lang.Object
uk.ac.starlink.table.storage.ArrayPrimitiveStore
- All Implemented Interfaces:
ValueStore
ValueStore implementation which stores primitive values in a normal
java array.
- Since:
- 1 Nov 2005
- Author:
- Mark Taylor
-
Constructor Details
-
ArrayPrimitiveStore
Constructs a new store. The suppliedclazz
must be a primitive type such asint.class
.- Parameters:
clazz
- primitive type to storesize
- length of the vector
-
-
Method Details
-
getType
Description copied from interface:ValueStore
Returns the class of value which this object can store.- Specified by:
getType
in interfaceValueStore
- Returns:
- primitive class
-
getLength
public long getLength()Description copied from interface:ValueStore
Returns the length of the vector.- Specified by:
getLength
in interfaceValueStore
- Returns:
- vector length
-
put
Description copied from interface:ValueStore
Stores a vector of values in this object.array
must be an array of values matchinggetType
. Elementioff
ofarray
is stored at indexindex
, elemntioff+1
atindex+1
, etc.- Specified by:
put
in interfaceValueStore
- Parameters:
index
- starting offset to write toarray
- array of values to storeioff
- offset into array from which the first value is takencount
- number of values to transfer
-
get
Description copied from interface:ValueStore
Retrieves a vector of values from this object.array
must be an array of type matchinggetType
. Every element ofarray
will be filled with values; the first retrieved from offsetindex
, the second fromindex+1
, etc.- Specified by:
get
in interfaceValueStore
- Parameters:
index
- starting offsetarray
- array to accept dataioff
- offset into array to which the first value is copiedcount
- number of values to transfer
-