@@ -218,6 +218,10 @@ public boolean hasMemory() {
218218 return (wmem != null );
219219 }
220220
221+ /**
222+ * Returns true if this sketch is in a Compact Memory Format.
223+ * @return true if this sketch is in a Compact Memory Format.
224+ */
221225 public boolean isCompactMemoryFormat () {
222226 return hasMemory () && sketchStructure != UPDATABLE ;
223227 }
@@ -488,9 +492,18 @@ final void setLevelsArrayAt(final int index, final int idxVal) {
488492 * Used to define the variable type of the current instance of this class.
489493 */
490494 public enum SketchType {
491- DOUBLES_SKETCH (Double .BYTES , "DoublesSketch" ),
492- FLOATS_SKETCH (Float .BYTES , "FloatsSketch" ),
493- ITEMS_SKETCH (0 , "ItemsSketch" );
495+ /**
496+ * KllDoublesSketch
497+ */
498+ DOUBLES_SKETCH (Double .BYTES , "KllDoublesSketch" ),
499+ /**
500+ * KllFloatsSketch
501+ */
502+ FLOATS_SKETCH (Float .BYTES , "KllFloatsSketch" ),
503+ /**
504+ * KllItemsSketch
505+ */
506+ ITEMS_SKETCH (0 , "KllItemsSketch" );
494507
495508 private int typeBytes ;
496509 private String name ;
@@ -500,18 +513,30 @@ private SketchType(final int typeBytes, final String name) {
500513 this .name = name ;
501514 }
502515
516+ /**
517+ * Gets the item size in bytes. If the item is generic, this returns zero.
518+ * @return the item size in bytes
519+ */
503520 public int getBytes () { return typeBytes ; }
504521
522+ /**
523+ * Get the name of the associated sketch
524+ * @return the name of the associated sketch
525+ */
505526 public String getName () { return name ; }
506527 }
507528
508529 /**
509530 * Used primarily to define the structure of the serialized sketch. Also used by the Heap Sketch.
510531 */
511532 public enum SketchStructure {
533+ /** Compact Empty Structure */
512534 COMPACT_EMPTY (PREAMBLE_INTS_EMPTY_SINGLE , SERIAL_VERSION_EMPTY_FULL ),
535+ /** Compact Single Item Structure */
513536 COMPACT_SINGLE (PREAMBLE_INTS_EMPTY_SINGLE , SERIAL_VERSION_SINGLE ),
537+ /** Compact Full Preamble Structure */
514538 COMPACT_FULL (PREAMBLE_INTS_FULL , SERIAL_VERSION_EMPTY_FULL ),
539+ /** Updatable Preamble Structure */
515540 UPDATABLE (PREAMBLE_INTS_FULL , SERIAL_VERSION_UPDATABLE ); //also used by the heap sketch.
516541
517542 private int preInts ;
@@ -522,10 +547,24 @@ private SketchStructure(final int preInts, final int serVer) {
522547 this .serVer = serVer ;
523548 }
524549
550+ /**
551+ * gets the Preamble Integers for this Structure.
552+ * @return the Preamble Integers for this Structure
553+ */
525554 public int getPreInts () { return preInts ; }
526555
556+ /**
557+ * gets the Serialization Version for this Structure.
558+ * @return the Serialization Version for this Structure.
559+ */
527560 public int getSerVer () { return serVer ; }
528561
562+ /**
563+ * gets the SketchStructure given preInts and serVer.
564+ * @param preInts the given preamble size in integers
565+ * @param serVer the given Serialization Version
566+ * @return the SketchStructure given preInts and serVer.
567+ */
529568 public static SketchStructure getSketchStructure (final int preInts , final int serVer ) {
530569 final SketchStructure [] ssArr = SketchStructure .values ();
531570 for (int i = 0 ; i < ssArr .length ; i ++) {
0 commit comments