/** Add a new element to this builder. */ public Builder add(long l) { if (pending == null) { throw new IllegalStateException("Cannot be reused after build()"); } if (pendingOff == pending.length) { // check size if (values.length == valuesOff) { final int newLength = ArrayUtil.oversize(valuesOff + 1, 8); grow(newLength); } pack(); } pending[pendingOff++] = l; size += 1; return this; }
@Override void grow(int newBlockCount) { super.grow(newBlockCount); ramBytesUsed -= RamUsageEstimator.sizeOf(mins); mins = Arrays.copyOf(mins, newBlockCount); ramBytesUsed += RamUsageEstimator.sizeOf(mins); }
@Override void grow(int newBlockCount) { super.grow(newBlockCount); ramBytesUsed -= RamUsageEstimator.sizeOf(mins); mins = Arrays.copyOf(mins, newBlockCount); ramBytesUsed += RamUsageEstimator.sizeOf(mins); }
/** Add a new element to this builder. */ public Builder add(long l) { if (pending == null) { throw new IllegalStateException("Cannot be reused after build()"); } if (pendingOff == pending.length) { // check size if (values.length == valuesOff) { final int newLength = ArrayUtil.oversize(valuesOff + 1, 8); grow(newLength); } pack(); } pending[pendingOff++] = l; size += 1; return this; }
/** Add a new element to this builder. */ public Builder add(long l) { if (pending == null) { throw new IllegalStateException("Cannot be reused after build()"); } if (pendingOff == pending.length) { // check size if (values.length == valuesOff) { final int newLength = ArrayUtil.oversize(valuesOff + 1, 8); grow(newLength); } pack(); } pending[pendingOff++] = l; size += 1; return this; }
/** Add a new element to this builder. */ public Builder add(long l) { if (pending == null) { throw new IllegalStateException("Cannot be reused after build()"); } if (pendingOff == pending.length) { // check size if (values.length == valuesOff) { final int newLength = ArrayUtil.oversize(valuesOff + 1, 8); grow(newLength); } pack(); } pending[pendingOff++] = l; size += 1; return this; }
final void finish() { if (pendingOff > 0) { if (values.length == valuesOff) { grow(valuesOff + 1); } pack(); } }
@Override void grow(int newBlockCount) { super.grow(newBlockCount); ramBytesUsed -= RamUsageEstimator.sizeOf(mins); mins = ArrayUtil.growExact(mins, newBlockCount); ramBytesUsed += RamUsageEstimator.sizeOf(mins); }
final void finish() { if (pendingOff > 0) { if (values.length == valuesOff) { grow(valuesOff + 1); } pack(); } }
final void finish() { if (pendingOff > 0) { if (values.length == valuesOff) { grow(valuesOff + 1); } pack(); } }
@Override void grow(int newBlockCount) { super.grow(newBlockCount); ramBytesUsed -= RamUsageEstimator.sizeOf(mins); mins = ArrayUtil.growExact(mins, newBlockCount); ramBytesUsed += RamUsageEstimator.sizeOf(mins); }
final void finish() { if (pendingOff > 0) { if (values.length == valuesOff) { grow(valuesOff + 1); } pack(); } }