/** {@inheritDoc} */ public boolean retainAll(byte[] array) { boolean changed = false; Arrays.sort(array); byte[] data = _data; for (int i = data.length; i-- > 0; ) { if (Arrays.binarySearch(array, data[i]) < 0) { remove(i, 1); changed = true; } } return changed; }
/** {@inheritDoc} */ public boolean removeAll(float[] array) { Arrays.sort(array); boolean modified = false; TFloatIterator iter = iterator(); while (iter.hasNext()) { if (Arrays.binarySearch(array, iter.next()) >= 0) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public void fill(int fromIndex, int toIndex, byte val) { if (toIndex > _pos) { ensureCapacity(toIndex); _pos = toIndex; } Arrays.fill(_data, fromIndex, toIndex, val); }
/** {@inheritDoc} */ public void fill(byte val) { Arrays.fill(_data, 0, _pos, val); }
/** {@inheritDoc} */ public void sort(int fromIndex, int toIndex) { Arrays.sort(_data, fromIndex, toIndex); }
/** {@inheritDoc} */ public void sort() { Arrays.sort(_data, 0, _pos); }
/** * Sets the size of the list to 0, but does not change its capacity. This method can be used as an * alternative to the {@link #clear()} method if you want to recycle a list without allocating new * backing arrays. */ public void reset() { _pos = 0; Arrays.fill(_data, no_entry_value); }
/** {@inheritDoc} */ public void sort(int fromIndex, int toIndex) { TFloatList tmp = subList(fromIndex, toIndex); float[] vals = tmp.toArray(); Arrays.sort(vals); set(fromIndex, vals); }