@@ -130,12 +130,12 @@ public boolean isSameResource(final MemorySegment that) {
130130
131131 @ Override
132132 public void reset () {
133- throw new SketchesReadOnlyException ("Call to reset() on read-only buffer " );
133+ throw new SketchesReadOnlyException ("Call to reset() on read-only sketch " );
134134 }
135135
136136 @ Override
137137 public void update (final double dataItem ) {
138- throw new SketchesReadOnlyException ("Call to update() on read-only buffer " );
138+ throw new SketchesReadOnlyException ("Call to update() on read-only sketch " );
139139 }
140140
141141 //Restricted overrides
@@ -147,8 +147,10 @@ int getBaseBufferCount() {
147147 }
148148
149149 @ Override
150- int getCombinedBufferItemCapacity () {
151- return Math .max (0 , (int )seg_ .byteSize () - COMBINED_BUFFER ) / 8 ;
150+ long getBitPattern () {
151+ final int k = getK ();
152+ final long n = getN ();
153+ return ClassicUtil .computeBitPattern (k , n );
152154 }
153155
154156 @ Override
@@ -159,15 +161,12 @@ int getCombinedBufferItemCapacity() {
159161 final int itemCap = ClassicUtil .computeCombinedBufferItemCapacity (k , n );
160162 final double [] combinedBuffer = new double [itemCap ];
161163 MemorySegment .copy (seg_ , JAVA_DOUBLE_UNALIGNED , COMBINED_BUFFER , combinedBuffer , 0 , itemCap );
162-
163164 return combinedBuffer ;
164165 }
165166
166167 @ Override
167- long getBitPattern () {
168- final int k = getK ();
169- final long n = getN ();
170- return ClassicUtil .computeBitPattern (k , n );
168+ int getCombinedBufferItemCapacity () {
169+ return Math .max (0 , (int )seg_ .byteSize () - COMBINED_BUFFER ) / 8 ;
171170 }
172171
173172 @ Override
@@ -177,19 +176,24 @@ MemorySegment getMemorySegment() {
177176
178177 @ Override
179178 UpdateDoublesSketch getSketchAndReset () {
180- throw new SketchesReadOnlyException ("Call to getResultAndReset() on read-only sketch" );
179+ throw new SketchesReadOnlyException ("Call to getSketchAndReset() on read-only sketch" );
180+ }
181+
182+ @ Override
183+ double [] growCombinedBuffer (final int curCombBufItemCap , final int itemSpaceNeeded ) {
184+ throw new SketchesReadOnlyException ("Call to growCombinedBuffer() on read-only sketch" );
181185 }
182186
183187 //Puts
184188
185189 @ Override
186190 void putMinItem (final double minQuantile ) {
187- throw new SketchesReadOnlyException ("Call to putMinQuantile () on read-only sketch" );
191+ throw new SketchesReadOnlyException ("Call to putMinItem () on read-only sketch" );
188192 }
189193
190194 @ Override
191195 void putMaxItem (final double maxQuantile ) {
192- throw new SketchesReadOnlyException ("Call to putMaxQuantile () on read-only sketch" );
196+ throw new SketchesReadOnlyException ("Call to putMaxItem () on read-only sketch" );
193197 }
194198
195199 @ Override
@@ -209,12 +213,7 @@ void putBaseBufferCount(final int baseBufferCount) {
209213
210214 @ Override
211215 void putBitPattern (final long bitPattern ) {
212- throw new SketchesReadOnlyException ("Call to putBaseBufferCount() on read-only sketch" );
213- }
214-
215- @ Override
216- double [] growCombinedBuffer (final int curCombBufItemCap , final int itemSpaceNeeded ) {
217- throw new SketchesReadOnlyException ("Call to growCombinedBuffer() on read-only sketch" );
216+ throw new SketchesReadOnlyException ("Call to putBitPattern() on read-only sketch" );
218217 }
219218
220219 //Checks
0 commit comments