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(); }
boolean retainAll(@Nonnull HashCharSet thisC, @Nonnull Collection<?> c) { if (c instanceof CharCollection) return retainAll(thisC, (CharCollection) c); throw new java.lang.UnsupportedOperationException(); }
@Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
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(); }
@Override public boolean moveNext() { if (expectedModCount == modCount()) { int[] tab = this.tab; char free = this.free; int entry; for (int i = index - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { index = i; curKey = key; return true; } } curKey = free; index = -1; return false; } else { 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(); }
@Override public boolean moveNext() { if (expectedModCount == modCount()) { int[] tab = this.tab; char free = this.free; int entry; for (int i = index - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { index = i; curKey = key; return true; } } curKey = free; index = -1; return false; } else { 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(); }
@Nonnull public char[] toCharArray() { int size = size(); char[] result = new char[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
public int setHashCode() { int hashCode = 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) { hashCode += key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return hashCode; }
boolean retainAll(@Nonnull HashCharSet thisC, @Nonnull Collection<?> c) { if (c instanceof CharCollection) return retainAll(thisC, (CharCollection) c); throw new java.lang.UnsupportedOperationException(); }
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; }
@Nonnull public char[] toCharArray() { int size = size(); char[] result = new char[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
public int setHashCode() { int hashCode = 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) { hashCode += key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return hashCode; }
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; }
@Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
public CharCursor setCursor() { int mc = modCount(); return new NoRemovedCursor(mc); }
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(); }
@Nonnull public char[] toArray(char[] a) { int size = size(); if (a.length < size) a = new char[size]; if (size == 0) { if (a.length > 0) a[0] = (char) 0; return a; } int resultIndex = 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) { a[resultIndex++] = key; } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = (char) 0; return a; }
@Override public char nextChar() { int nextI; if ((nextI = nextIndex) >= 0) { if (expectedModCount == modCount()) { int[] tab = this.tab; char free = this.free; char prev = next; int entry; while (--nextI >= 0) { char key; if ((key = (char) (entry = tab[nextI])) != free) { next = key; break; } } nextIndex = nextI; return prev; } else { throw new java.util.ConcurrentModificationException(); } } else { throw new java.util.NoSuchElementException(); } }