public void forEach(Consumer<? super Byte> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public String setToString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { sb.append(' ').append(key).append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }
public String setToString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { sb.append(' ').append(key).append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }
public boolean reverseAddAllTo(ByteCollection c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public void forEach(ByteConsumer action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public void forEach(ByteConsumer action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public void forEach(Consumer<? super Byte> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public boolean reverseAddAllTo(ByteCollection c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean forEachWhile( BytePredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public boolean allContainingIn(ByteCollection c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean forEachWhile( BytePredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public boolean allContainingIn(ByteCollection c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean reverseRemoveAllFrom(ByteSet s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { changed |= s.removeByte(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseRemoveAllFrom(ByteSet s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); byte free = freeValue; char[] tab = table; long base = CHAR_BASE + BYTE_KEY_OFFSET; for (long off = ((long) tab.length) << CHAR_SCALE_SHIFT; (off -= CHAR_SCALE) >= 0L;) { byte key; if ((key = U.getByte(tab, base + off)) != free) { changed |= s.removeByte(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }