public void forEach(Consumer<? super Character> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(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(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(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(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(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 void forEach(CharConsumer action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public void forEach(CharConsumer action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public void forEach(Consumer<? super Character> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public boolean forEachWhile( CharPredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public boolean forEachWhile( CharPredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public boolean reverseAddAllTo(CharCollection c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean allContainingIn(CharCollection c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean reverseAddAllTo(CharCollection c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean allContainingIn(CharCollection c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean reverseRemoveAllFrom(CharSet s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { changed |= s.removeChar(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseRemoveAllFrom(CharSet s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; long base = INT_BASE + CHAR_KEY_OFFSET; for (long off = ((long) tab.length) << INT_SCALE_SHIFT; (off -= INT_SCALE) >= 0L;) { char key; if ((key = U.getChar(tab, base + off)) != free) { changed |= s.removeChar(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }