Interface ArrayFactory
public interface ArrayFactory
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final org.apache.commons.logging.Log -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Array<?>allocate(Types.ValueType v, int nRow) static Array<?>allocate(Types.ValueType v, int nRow, boolean optional) static Array<?>allocate(Types.ValueType v, int nRow, String val) static ObjectallocateBacking(Types.ValueType vt, int nRow) Allocate the raw backing array for a column of the given value type: the inverse ofcreate(ValueType, Object).static ABooleanArrayallocateBoolean(int nRow) static Array<?>allocateOptional(Types.ValueType v, int nRow) static <C> Array<C>append arrays to each other, and cast to highest common type if different types.static BooleanArraycreate(boolean[] col) static CharArraycreate(char[] col) static DoubleArraycreate(double[] col) static FloatArraycreate(float[] col) static IntegerArraycreate(int[] col) static LongArraycreate(long[] col) static StringArraystatic BitSetArraystatic Array<?>create(Types.ValueType vt, Object col) Wrap a fully populated raw typed column array into anArrayof the given value type.static <T> Array<T>create(T[] col) static <T> RaggedArray<T>create(T[] col, int m) static HashIntegerArraycreateHash32(int[] col) static HashIntegerArraycreateHash32(String[] col) static HashIntegerArraycreateHash32I(int[] col) static OptionalArray<Object>createHash32Opt(String[] col) static OptionalArray<Object>createHash32OptI(int[] col) static HashLongArraycreateHash64(long[] col) static HashLongArraycreateHash64(String[] col) static HashLongArraycreateHash64I(long[] col) static OptionalArray<Object>createHash64Opt(String[] col) static OptionalArray<Object>createHash64OptI(long[] col) static Objectstatic longgetInMemorySize(Types.ValueType type, int _numRows, boolean containsNull) static ObjectparseString(String s, Types.ValueType v) static Array<?>static <C> Array<C>Set the target array in the range of rl to ru with the src array.
-
Field Details
-
LOG
static final org.apache.commons.logging.Log LOG -
bitSetSwitchPoint
static final int bitSetSwitchPoint- See Also:
-
-
Method Details
-
create
-
createHash64I
-
createHash64
-
createHash32I
-
createHash32
-
createHash64Opt
-
createHash64OptI
-
createHash32Opt
-
createHash32OptI
-
createHash64
-
createHash32
-
create
-
create
-
create
-
create
-
create
-
create
-
create
-
create
-
create
-
create
Wrap a fully populated raw typed column array into anArrayof the given value type. The runtime type ofcolmust match the primitive backing type ofvt(e.g.double[]forTypes.ValueType.FP64,String[]forTypes.ValueType.STRING).For
Types.ValueType.BOOLEANthis mirrorsallocateBoolean(int): aboolean[]longer thanbitSetSwitchPointis bit-packed into a compactBitSetArray(so a bulk decoder that fills a plainboolean[]still ends up with the same representation as every other frame allocation path), while shorter columns stay a plainBooleanArray.- Parameters:
vt- the value type of the columncol- the backing array to wrap- Returns:
- an
Arrayview overcol(boolean columns may be bit-packed rather than wrapped in place)
-
allocateBacking
Allocate the raw backing array for a column of the given value type: the inverse ofcreate(ValueType, Object). Returnsdouble[]forTypes.ValueType.FP64,int[]for INT32/UINT/HASH32,long[]for INT64/HASH64,String[]for STRING, etc. The runtime array type matches whatcreate(ValueType, Object)expects, so a bulk decoder can fill this primitive array directly and then wrap it viacreate(vt, backing).- Parameters:
vt- the value type of the columnnRow- the number of rows to allocate- Returns:
- a freshly allocated raw backing array of the matching primitive/object type
-
getInMemorySize
-
allocate
-
allocate
-
allocateOptional
-
allocateBoolean
-
allocate
-
read
- Throws:
IOException
-
append
append arrays to each other, and cast to highest common type if different types.- Type Parameters:
C- The type to return, java automatically make this Object, and this is fine.- Parameters:
a- The first array to append to (potentially modifying this a if applicable)b- The array to append to a, (not getting modified).- Returns:
- A array containing the concatenation of the two.
-
set
Set the target array in the range of rl to ru with the src array. The type returned is the common or highest common type of array. The source array is assumed to be at least of ru size.- Type Parameters:
C- The highest common type to return.- Parameters:
target- The target to put the values intosrc- The source to take the values fromrl- The index to start onru- The index to end on (inclusive)rlen- The length of the target (a parameter in case target is null)- Returns:
- A new or modified array.
-
parseString
-
defaultNullValue
-