@Override public void getFloatArr(long byteIndex, float[] target, int elemoff, int numElems) { for ( int i=0; i <numElems; i++ ) { target[i+elemoff] = buffer.getFloat((int) (byteIndex+i * 4)); } }
@Override public double getDouble(ByteBuffer buf, int position) { return (double) buf.getFloat(position + Long.BYTES); }
@Override public void getFromByteBuffer(ByteBuffer buffer, int initialOffset, int dimValIdx, Comparable[] dimValues) { dimValues[dimValIdx] = buffer.getFloat(initialOffset + keyBufferPosition); }
@Override public float getFloat(ByteBuffer buf, int position) { return buf.getFloat(position + Long.BYTES); }
@Override public long getLong(ByteBuffer buf, int position) { return (long) buf.getFloat(position + Long.BYTES); }
@Override public final long getLong(ByteBuffer buf, int position) { return (long) buf.getFloat(position); }
@Override public double getDouble(ByteBuffer buffer, int position) { return (double) buffer.getFloat(position); }
@Override public long getLong(ByteBuffer buf, int position) { return (long) buf.getFloat(position + Long.BYTES); }
@Override public float getFloat(ByteBuffer buf, int position) { return buf.getFloat(position + Long.BYTES); }
@Override public float get (int index) { if (index < 0 || index >= limit) { throw new IndexOutOfBoundsException(); } return byteBuffer.getFloat(index << 2); }
@Override public float get (int index) { if (index < 0 || index >= limit) { throw new IndexOutOfBoundsException(); } return byteBuffer.getFloat(index << 2); }
@Override public void aggregate(ByteBuffer buf, int position, float value) { buf.putFloat(position, buf.getFloat(position) + value); }
@Override public void aggregate(ByteBuffer buf, int position, float value) { buf.putFloat(position, Math.min(buf.getFloat(position), value)); } }
@Override public void aggregate(ByteBuffer buf, int position, float value) { buf.putFloat(position, Math.max(buf.getFloat(position), value)); } }
@Override public float get () { if (position == limit) { throw new BufferUnderflowException(); } return byteBuffer.getFloat(position++ << 2); }
@Override public float get () { if (position == limit) { throw new BufferUnderflowException(); } return byteBuffer.getFloat(position++ << 2); }
@Override public Object get(ByteBuffer buf, int position) { long[] bins = new long[breaks.length + 1]; ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); mutationBuffer.asLongBuffer().get(bins); float min = mutationBuffer.getFloat(position + minOffset); float max = mutationBuffer.getFloat(position + maxOffset); return new Histogram(breaks, bins, min, max); }
/** * Read the next {@code float} from the underlying {@link ByteBuffer}. * * @return The next {@code float}. */ public float readFloat() { if (null != buffer) { return buffer.getFloat(); } throw new BufferUnderflowException(); }
@Override public void processValueFromGroupingKey( GroupByColumnSelectorPlus selectorPlus, ByteBuffer key, Map<String, Object> resultMap, int keyBufferPosition ) { final float val = key.getFloat(keyBufferPosition); resultMap.put(selectorPlus.getOutputName(), val); }
@Override public Object get(ByteBuffer buf, int position) { return new SerializablePair<>(buf.getLong(position), buf.getFloat(position + Long.BYTES)); }