@Override public void writePositionTo(int position, BlockBuilder blockBuilder) { checkReadablePosition(position); blockBuilder.appendStructureInternal(this, position); }
@Override public boolean isNull(int position) { checkReadablePosition(position); boolean[] valueIsNull = getValueIsNull(); return valueIsNull == null ? false : valueIsNull[position + getOffsetBase()]; }
@Override public <T> T getObject(int position, Class<T> clazz) { if (clazz != Block.class) { throw new IllegalArgumentException("clazz must be Block.class"); } checkReadablePosition(position); int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); return clazz.cast(getRawElementBlock().getRegion(startValueOffset, endValueOffset - startValueOffset)); }
public <T> T apply(ArrayBlockFunction<T> function, int position) { checkReadablePosition(position); int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); return function.apply(getRawElementBlock(), startValueOffset, endValueOffset - startValueOffset); }
@Override public long getEstimatedDataSizeForStats(int position) { checkReadablePosition(position); if (isNull(position)) { return 0; } int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); Block rawElementBlock = getRawElementBlock(); long size = 0; for (int i = startValueOffset; i < endValueOffset; i++) { size += rawElementBlock.getEstimatedDataSizeForStats(i); } return size; }
@Override public Block getSingleValueBlock(int position) { checkReadablePosition(position); int startValueOffset = getOffset(position); int valueLength = getOffset(position + 1) - startValueOffset; Block newValues = getRawElementBlock().copyRegion(startValueOffset, valueLength); return createArrayBlockInternal( 0, 1, new boolean[] {isNull(position)}, new int[] {0, valueLength}, newValues); }
@Override public void writePositionTo(int position, BlockBuilder blockBuilder) { checkReadablePosition(position); blockBuilder.appendStructureInternal(this, position); }
@Override public boolean isNull(int position) { checkReadablePosition(position); boolean[] valueIsNull = getValueIsNull(); return valueIsNull == null ? false : valueIsNull[position + getOffsetBase()]; }
@Override public <T> T getObject(int position, Class<T> clazz) { if (clazz != Block.class) { throw new IllegalArgumentException("clazz must be Block.class"); } checkReadablePosition(position); int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); return clazz.cast(getRawElementBlock().getRegion(startValueOffset, endValueOffset - startValueOffset)); }
public <T> T apply(ArrayBlockFunction<T> function, int position) { checkReadablePosition(position); int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); return function.apply(getRawElementBlock(), startValueOffset, endValueOffset - startValueOffset); }
@Override public long getEstimatedDataSizeForStats(int position) { checkReadablePosition(position); if (isNull(position)) { return 0; } int startValueOffset = getOffset(position); int endValueOffset = getOffset(position + 1); Block rawElementBlock = getRawElementBlock(); long size = 0; for (int i = startValueOffset; i < endValueOffset; i++) { size += rawElementBlock.getEstimatedDataSizeForStats(i); } return size; }
@Override public Block getSingleValueBlock(int position) { checkReadablePosition(position); int startValueOffset = getOffset(position); int valueLength = getOffset(position + 1) - startValueOffset; Block newValues = getRawElementBlock().copyRegion(startValueOffset, valueLength); return createArrayBlockInternal( 0, 1, new boolean[] {isNull(position)}, new int[] {0, valueLength}, newValues); }