/** decodes the min value (for the defined dimension) from the encoded input byte array */ static double decodeMin(byte[] b, int dimension) { int offset = dimension*BYTES; return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(b, offset)); }
/** decodes the max value (for the defined dimension) from the encoded input byte array */ static double decodeMax(byte[] b, int dimension) { int offset = b.length/2 + dimension*BYTES; return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(b, offset)); }
/** Decode single double dimension */ public static double decodeDimension(byte value[], int offset) { return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(value, offset)); }
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) { double value = NumericUtils.sortableLongToDouble(bucket.term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.format); } }
@Override public double nextValue() throws IOException { return NumericUtils.sortableLongToDouble(values.nextValue()); }
@Override public double doubleValue() throws IOException { return NumericUtils.sortableLongToDouble(values.longValue()); }
/** decodes the max value (for the defined dimension) from the encoded input byte array */ static double decodeMax(byte[] b, int dimension) { int offset = b.length/2 + dimension*BYTES; return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(b, offset)); }
@Override final public Double to(final BytesRef bytesRef) { if (isEmpty(bytesRef)) return null; checkByteSize(bytesRef, Double.BYTES, "Cannot convert value to double"); return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(bytesRef.bytes, 0)); } }
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) { double value = NumericUtils.sortableLongToDouble(bucket.term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.format); } }
@Override public double doubleValue() throws IOException { return NumericUtils.sortableLongToDouble(values.longValue()); }
/** decodes the min value (for the defined dimension) from the encoded input byte array */ static double decodeMin(byte[] b, int dimension) { int offset = dimension*BYTES; return NumericUtils.sortableLongToDouble(NumericUtils.sortableBytesToLong(b, offset)); }
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) { double value = NumericUtils.sortableLongToDouble(bucket.term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.format); } }
@Override public double valueAt(int index) { return NumericUtils.sortableLongToDouble(values.valueAt(index)); }
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) { double value = NumericUtils.sortableLongToDouble(bucket.term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.format); } }
@Override public double get(int docID) { return NumericUtils.sortableLongToDouble(values.get(docID)); }
@Override final public Double convert(final int docId) throws IOException { return NumericUtils.sortableLongToDouble(reader.getNumericDocValues(docId, field)); }
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) { double value = NumericUtils.sortableLongToDouble(bucket.term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.format); } }
@Override final public void collect(final int doc) { count++; final double value = NumericUtils.sortableLongToDouble(docValues.get(doc)); if (value > result) result = value; } }
private static DoubleTerms.Bucket convertToDouble(InternalTerms.Bucket bucket) { final long term = ((Number) bucket.getKey()).longValue(); final double value = NumericUtils.sortableLongToDouble(term); return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.formatter); }
@Override public FieldStats stats(Terms terms, int maxDoc) throws IOException { double minValue = NumericUtils.sortableLongToDouble(NumericUtils.getMinLong(terms)); double maxValue = NumericUtils.sortableLongToDouble(NumericUtils.getMaxLong(terms)); return new FieldStats.Double( maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue ); } }