public int size() {
return size;
}
public TColumn toTColumn() {
TColumn value = new TColumn();
ByteBuffer nullMasks = ByteBuffer.wrap(toBinary(nulls));
switch (type) {
case BOOLEAN_TYPE:
value.setBoolVal(new TBoolColumn(Booleans.asList(Arrays.copyOfRange(boolVars, 0, size)), nullMasks));
break;
case TINYINT_TYPE:
value.setByteVal(new TByteColumn(Bytes.asList(Arrays.copyOfRange(byteVars, 0, size)), nullMasks));
break;
case SMALLINT_TYPE:
value.setI16Val(new TI16Column(Shorts.asList(Arrays.copyOfRange(shortVars, 0, size)), nullMasks));
break;
case INT_TYPE:
value.setI32Val(new TI32Column(Ints.asList(Arrays.copyOfRange(intVars, 0, size)), nullMasks));
break;
case BIGINT_TYPE:
value.setI64Val(new TI64Column(Longs.asList(Arrays.copyOfRange(longVars, 0, size)), nullMasks));
break;
case DOUBLE_TYPE:
value.setDoubleVal(new TDoubleColumn(Doubles.asList(Arrays.copyOfRange(doubleVars, 0, size)), nullMasks));
break;
case STRING_TYPE:
value.setStringVal(new TStringColumn(stringVars, nullMasks));
break;
case BINARY_TYPE:
value.setBinaryVal(new TBinaryColumn(binaryVars, nullMasks));
break;
}
return value;
}