/** * Get the element at the specified position. * * @param index position of the value * @return value of the element, if not null * @throws IllegalStateException if the value is null */ public DrillBuf get(int index) { if (isNull(index)) { throw new IllegalStateException("Can't get a null value"); } return vAccessor.get(index); }
@Override public Object readObject() { List<Object> valList = Lists.newArrayList(); for (int i = repeatedHolder.start; i < repeatedHolder.end; i++) { valList.add(repeatedHolder.vector.getAccessor().getObject(i)); } return valList; }
public void read(Decimal28SparseHolder h) { vector.getAccessor().get(idx(), h); }
public void getFieldById(int fieldId, Decimal28SparseHolder holder){ ((Decimal28SparseVector) vectors[fieldId]).getAccessor().get(currentIndex, holder); }
public Object readObject() { return vector.getAccessor().getObject(idx()); }
public BigDecimal readBigDecimal() { return vector.getAccessor().getObject(idx()); }
/** * Get the element at the specified position. * * @param index position of the value * @return value of the element, if not null * @throws IllegalStateException if the value is null */ public DrillBuf get(int index) { if (isNull(index)) { throw new IllegalStateException("Can't get a null value"); } return vAccessor.get(index); }
public BigDecimal getSingleObject(int index, int arrayIndex) { final int start = offsets.getAccessor().get(index); return values.getAccessor().getObject(start + arrayIndex); }
@Override public Object getObject(int index) { return ac.getObject(index); }
public void read(NullableDecimal28SparseHolder h) { vector.getAccessor().get(idx(), h); }
public void get(int index, int positionIndex, NullableDecimal28SparseHolder holder) { final int offset = offsets.getAccessor().get(index); assert offset >= 0; if (positionIndex >= getInnerValueCountAt(index)) { holder.isSet = 0; return; } values.getAccessor().get(offset + positionIndex, holder); } }
@Override public List<BigDecimal> getObject(int index) { final List<BigDecimal> vals = new JsonStringArrayList<>(); final UInt4Vector.Accessor offsetsAccessor = offsets.getAccessor(); final int start = offsetsAccessor.get(index); final int end = offsetsAccessor.get(index + 1); final Decimal28SparseVector.Accessor valuesAccessor = values.getAccessor(); for(int i = start; i < end; i++) { vals.add(valuesAccessor.getObject(i)); } return vals; }
public void get(int index, NullableDecimal28SparseHolder holder){ vAccessor.get(index, holder); holder.isSet = bAccessor.get(index); holder.scale = getField().getScale(); holder.precision = getField().getPrecision(); }
@Override public BigDecimal getBigDecimal(int index) { return ac.getObject(index); }
public void fromNotNullable(Decimal28SparseVector srce) { clear(); final int valueCount = srce.getAccessor().getValueCount(); // Create a new bits vector, all values non-null fillBitsVector(getBitsVector(), valueCount); // Swap the data portion getValuesVector().exchange(srce); setValueCount(valueCount); } }
public void add(int index, RepeatedDecimal28SparseHolder holder) { final Decimal28SparseVector.Accessor accessor = holder.vector.getAccessor(); final Decimal28SparseHolder innerHolder = new Decimal28SparseHolder(); for(int i = holder.start; i < holder.end; i++) { accessor.get(i, innerHolder); add(index, innerHolder); } }
/** * Get a value for the given record. Each element in the repeated field is accessed by * the positionIndex param. * * @param index record containing the repeated field * @param positionIndex position within the repeated field * @return element at the given position in the given record */ public DrillBuf get(int index, int positionIndex) { return values.getAccessor().get(offsets.getAccessor().get(index) + positionIndex); }
@Override public boolean next() { if(index + 1 < repeatedHolder.end) { index++; repeatedHolder.vector.getAccessor().get(repeatedHolder.start + index, holder); return true; } else { return false; } }
@Override public void generateTestData(int count) { setValueCount(count); boolean even = true; final int valueCount = getAccessor().getValueCount(); for(int i = 0; i < valueCount; i++, even = !even) { final byte b = even ? Byte.MIN_VALUE : Byte.MAX_VALUE; for(int w = 0; w < VALUE_WIDTH; w++) { data.setByte(i + w, b); } } }