Skip to content

Commit

Permalink
Update javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Rhodes committed Feb 5, 2016
1 parent a900b7c commit 792486a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ public QuantilesSketchBuilder() {

/**
* Sets the parameter <i>k</i> that determines the accuracy and size of the sketch
* @param k determines the accuracy and size of the sketch. <i>k</i> must be greater than 0 and
* less than 65536.
* @param k determines the accuracy and size of the sketch.
* <i>k</i> must be greater than 0 and less than 65536.
* It is recommended that <i>k</i> be a power of 2 to enable merging of sketches with
* different values of <i>k</i>.
* different values of <i>k</i>. However, in this case it is only possible to merge from
* larger values of <i>k</i> to smaller values.
* @return this builder
*/
public QuantilesSketchBuilder setK(int k) {
Expand Down Expand Up @@ -115,7 +116,11 @@ public QuantilesSketch build() {
* Returns a QuantilesSketch with the current configuration of this Builder and the
* given parameter <i>k</i>.
* @param k determines the accuracy and size of the sketch.
* Must be greater than 0 and less than 65536.
* <i>k</i> must be greater than 0 and less than 65536.
* It is recommended that <i>k</i> be a power of 2 to enable merging of sketches with
* different values of <i>k</i>. However, in this case it is only possible to merge from
* larger values of <i>k</i> to smaller values.
*
* @return a QuantilesSketch
*/
public QuantilesSketch build(int k) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,14 @@ public void checkGetSeed() {
assertEquals(qs1.getSeed(), 0);
}

@Test(expectedExceptions = IllegalArgumentException.class)
public void checkImproperBuild() {
Memory mem = new NativeMemory(new byte[1024]);
@SuppressWarnings("unused")
QuantilesSketch qs1 = QuantilesSketch.builder().initMemory(mem).build(4);

}

@Test
public void checkKisOne() {
QuantilesSketch qs1 = QuantilesSketch.builder().build(1);
Expand Down

0 comments on commit 792486a

Please sign in to comment.