4646import org .apache .datasketches .common .Util ;
4747
4848/**
49- * The parent class of all the CompactSketches. CompactSketches are never created directly.
50- * They are created as a result of the compact() method of an UpdateSketch , a result of a
51- * getResult() of a SetOperation , or from a heapify method.
49+ * The parent class of all the CompactThetaSketches. CompactThetaSketches are never created directly.
50+ * They are created as a result of the compact() method of an UpdatableThetaSketch , a result of a
51+ * getResult() of a ThetaSetOperation , or from a heapify method.
5252 *
53- * <p>A CompactSketch is the simplest form of a Theta Sketch . It consists of a compact list
53+ * <p>A CompactThetaSketch is the simplest form of a ThetaSketches . It consists of a compact list
5454 * (i.e., no intervening spaces) of hash values, which may be ordered or not, a value for theta
55- * and a seed hash. A CompactSketch is immutable (read-only),
55+ * and a seed hash. A CompactThetaSketch is immutable (read-only),
5656 * and the space required when stored is only the space required for the hash values and 8 to 24
57- * bytes of preamble. An empty CompactSketch consumes only 8 bytes.</p>
57+ * bytes of preamble. An empty CompactThetaSketch consumes only 8 bytes.</p>
5858 *
5959 * @author Lee Rhodes
6060 */
61- public abstract class CompactSketch extends ThetaSketch {
61+ public abstract class CompactThetaSketch extends ThetaSketch {
6262
6363 /**
64- * Heapify takes a CompactSketch image in a MemorySegment and instantiates an on-heap CompactSketch .
64+ * Heapify takes a CompactThetaSketch image in a MemorySegment and instantiates an on-heap CompactThetaSketch .
6565 *
6666 * <p>The resulting sketch will not retain any link to the source MemorySegment and all of its data will be
67- * copied to the heap CompactSketch .</p>
67+ * copied to the heap CompactThetaSketch .</p>
6868 *
6969 * <p>The {@link Util#DEFAULT_UPDATE_SEED DEFAULT_UPDATE_SEED} is assumed.</p>
7070 *
71- * @param srcSeg an image of a CompactSketch .
72- * @return a CompactSketch on the heap.
71+ * @param srcSeg an image of a CompactThetaSketch .
72+ * @return a CompactThetaSketch on the heap.
7373 */
74- public static CompactSketch heapify (final MemorySegment srcSeg ) {
74+ public static CompactThetaSketch heapify (final MemorySegment srcSeg ) {
7575 return heapify (srcSeg , Util .DEFAULT_UPDATE_SEED );
7676 }
7777
7878 /**
79- * Heapify takes a CompactSketch image in a MemorySegment and instantiates an on-heap CompactSketch .
79+ * Heapify takes a CompactThetaSketch image in a MemorySegment and instantiates an on-heap CompactThetaSketch .
8080 *
8181 * <p>The resulting sketch will not retain any link to the source MemorySegment and all of its data will be
82- * copied to the heap CompactSketch .</p>
82+ * copied to the heap CompactThetaSketch .</p>
8383 *
8484 * <p>This method checks if the given expectedSeed was used to create the source MemorySegment image.</p>
8585 *
86- * @param srcSeg an image of a CompactSketch that was created using the given expectedSeed.
86+ * @param srcSeg an image of a CompactThetaSketch that was created using the given expectedSeed.
8787 * @param expectedSeed the seed used to validate the given MemorySegment image.
8888 * <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
89- * @return a CompactSketch on the heap.
89+ * @return a CompactThetaSketch on the heap.
9090 */
91- public static CompactSketch heapify (final MemorySegment srcSeg , final long expectedSeed ) {
91+ public static CompactThetaSketch heapify (final MemorySegment srcSeg , final long expectedSeed ) {
9292 final int serVer = extractSerVer (srcSeg );
9393 final int familyID = extractFamilyID (srcSeg );
9494 final Family family = idToFamily (familyID );
@@ -111,7 +111,7 @@ public static CompactSketch heapify(final MemorySegment srcSeg, final long expec
111111 }
112112
113113 /**
114- * Wrap takes the CompactSketch image in given MemorySegment and refers to it directly.
114+ * Wrap takes the CompactThetaSketch image in given MemorySegment and refers to it directly.
115115 * There is no data copying onto the java heap.
116116 * The wrap operation enables fast read-only merging and access to all the public read-only API.
117117 *
@@ -121,10 +121,10 @@ public static CompactSketch heapify(final MemorySegment srcSeg, final long expec
121121 *
122122 * <p>The {@link Util#DEFAULT_UPDATE_SEED DEFAULT_UPDATE_SEED} is assumed.</p>
123123 *
124- * @param srcSeg an image of a Sketch .
125- * @return a CompactSketch backed by the given MemorySegment.
124+ * @param srcSeg an image of a CompactThetaSketch .
125+ * @return a CompactThetaSketch backed by the given MemorySegment.
126126 */
127- public static CompactSketch wrap (final MemorySegment srcSeg ) {
127+ public static CompactThetaSketch wrap (final MemorySegment srcSeg ) {
128128 return wrap (srcSeg , Util .DEFAULT_UPDATE_SEED );
129129 }
130130
@@ -139,12 +139,12 @@ public static CompactSketch wrap(final MemorySegment srcSeg) {
139139 *
140140 * <p>This method checks if the given expectedSeed was used to create the source MemorySegment image.</p>
141141 *
142- * @param srcSeg an image of a Sketch that was created using the given expectedSeed.
142+ * @param srcSeg an image of a CompactThetaSketch that was created using the given expectedSeed.
143143 * @param expectedSeed the seed used to validate the given MemorySegment image.
144144 * <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
145- * @return a CompactSketch backed by the given MemorySegment.
145+ * @return a CompactThetaketch backed by the given MemorySegment.
146146 */
147- public static CompactSketch wrap (final MemorySegment srcSeg , final long expectedSeed ) {
147+ public static CompactThetaSketch wrap (final MemorySegment srcSeg , final long expectedSeed ) {
148148 final int serVer = extractSerVer (srcSeg );
149149 final int familyID = extractFamilyID (srcSeg );
150150 final Family family = Family .idToFamily (familyID );
@@ -196,11 +196,11 @@ public static CompactSketch wrap(final MemorySegment srcSeg, final long expected
196196 *
197197 * <p>This method checks if the DEFAULT_UPDATE_SEED was used to create the source byte array image.</p>
198198 *
199- * @param bytes a byte array image of a Sketch that was created using the DEFAULT_UPDATE_SEED.
199+ * @param bytes a byte array image of a CompactThetaSketch that was created using the DEFAULT_UPDATE_SEED.
200200 *
201- * @return a CompactSketch backed by the given byte array except as above.
201+ * @return a CompactThetaSketch backed by the given byte array except as above.
202202 */
203- public static CompactSketch wrap (final byte [] bytes ) {
203+ public static CompactThetaSketch wrap (final byte [] bytes ) {
204204 return wrap (bytes , Util .DEFAULT_UPDATE_SEED );
205205 }
206206
@@ -217,12 +217,12 @@ public static CompactSketch wrap(final byte[] bytes) {
217217 *
218218 * <p>This method checks if the given expectedSeed was used to create the source byte array image.</p>
219219 *
220- * @param bytes a byte array image of a Sketch that was created using the given expectedSeed.
220+ * @param bytes a byte array image of a CompactThetaSketch that was created using the given expectedSeed.
221221 * @param expectedSeed the seed used to validate the given byte array image.
222222 * <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
223- * @return a CompactSketch backed by the given byte array except as above.
223+ * @return a CompactThetaSketch backed by the given byte array except as above.
224224 */
225- public static CompactSketch wrap (final byte [] bytes , final long expectedSeed ) {
225+ public static CompactThetaSketch wrap (final byte [] bytes , final long expectedSeed ) {
226226 final int serVer = bytes [PreambleUtil .SER_VER_BYTE ];
227227 final int familyId = bytes [PreambleUtil .FAMILY_BYTE ];
228228 final Family family = Family .idToFamily (familyId );
@@ -261,10 +261,10 @@ public static CompactSketch wrap(final byte[] bytes, final long expectedSeed) {
261261 "Corrupted: Serialization Version " + serVer + " not recognized." );
262262 }
263263
264- //Sketch Overrides
264+ //ThetaSketch Overrides
265265
266266 @ Override
267- public abstract CompactSketch compact (final boolean dstOrdered , final MemorySegment dstSeg );
267+ public abstract CompactThetaSketch compact (final boolean dstOrdered , final MemorySegment dstSeg );
268268
269269 @ Override
270270 public int getCompactBytes () {
@@ -385,7 +385,7 @@ private byte[] toByteArrayV4() {
385385 return bytes ;
386386 }
387387
388- private static CompactSketch heapifyV4 (final MemorySegment srcSeg , final long seed ) {
388+ private static CompactThetaSketch heapifyV4 (final MemorySegment srcSeg , final long seed ) {
389389 final int preLongs = ThetaSketch .getPreambleLongs (srcSeg );
390390 final int entryBits = extractEntryBitsV4 (srcSeg );
391391 final int numEntriesBytes = extractNumEntriesBytesV4 (srcSeg );
0 commit comments