@Test public void testIntEncoding() { Random gen = getRandom(); ByteBuffer buf = ByteBuffer.allocate(10000); List<Integer> ref = Lists.newArrayList(); for (int i = 0; i < 3000; i++) { int n = gen.nextInt(); n = n >>> (i / 100); ref.add(n); AbstractTDigest.encode(buf, n); } buf.flip(); for (int i = 0; i < 3000; i++) { int n = AbstractTDigest.decode(buf); assertEquals(String.format("%d:", i), ref.get(i).intValue(), n); } }
public abstract void add(double x, int w);
TDigest implements Serializable { public abstract void add(double x, int w); }
TDigest implements Serializable { public abstract void add(double x, int w);  }
TDigest implements Serializable { public abstract void add(double x, int w);  @SuppressWarnings("WeakerAccess") static TDigest createMergingDigest(double compression); @SuppressWarnings("WeakerAccess") static TDigest createAvlTreeDigest(double compression); @SuppressWarnings({"unused", "WeakerAccess", "SameParameterValue"}) static TDigest createDigest(double compression); abstract void add(double x, int w); abstract void add(List<? extends TDigest> others); abstract void compress(); abstract long size(); abstract double cdf(double x); abstract double quantile(double q); abstract Collection<Centroid> centroids(); abstract double compression(); abstract int byteSize(); abstract int smallByteSize(); void setScaleFunction(ScaleFunction scaleFunction); abstract void asBytes(ByteBuffer buf); abstract void asSmallBytes(ByteBuffer buf); abstract TDigest recordAllData(); abstract boolean isRecording(); abstract void add(double x); abstract void add(TDigest other); abstract int centroidCount(); double getMin(); double getMax(); }
TDigest implements Serializable { public abstract void add(double x, int w);  @SuppressWarnings("WeakerAccess") static TDigest createMergingDigest(double compression); @SuppressWarnings("WeakerAccess") static TDigest createAvlTreeDigest(double compression); @SuppressWarnings({"unused", "WeakerAccess", "SameParameterValue"}) static TDigest createDigest(double compression); abstract void add(double x, int w); abstract void add(List<? extends TDigest> others); abstract void compress(); abstract long size(); abstract double cdf(double x); abstract double quantile(double q); abstract Collection<Centroid> centroids(); abstract double compression(); abstract int byteSize(); abstract int smallByteSize(); void setScaleFunction(ScaleFunction scaleFunction); abstract void asBytes(ByteBuffer buf); abstract void asSmallBytes(ByteBuffer buf); abstract TDigest recordAllData(); abstract boolean isRecording(); abstract void add(double x); abstract void add(TDigest other); abstract int centroidCount(); double getMin(); double getMax();  }