@Override public String toString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { sb.append(' '); sb.append(key); sb.append('='); sb.append((short) (entry >>> 16)); sb.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 String toString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { sb.append(' '); sb.append(key); sb.append('='); sb.append((short) (entry >>> 16)); sb.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 final void forEach(@Nonnull Consumer<? super Map.Entry<Character, Short>> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { action.accept(new MutableEntry(mc, i, key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public boolean forEachWhile(@Nonnull Predicate<? super Map.Entry<Character, Short>> 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; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { if (!predicate.test(new MutableEntry(mc, i, key, (short) (entry >>> 16)))) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
@Override public boolean forEachWhile(@Nonnull Predicate<? super Map.Entry<Character, Short>> 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; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { if (!predicate.test(new MutableEntry(mc, i, key, (short) (entry >>> 16)))) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
@Override public final boolean allContainingIn(ObjCollection<?> c) { if (isEmpty()) return true; boolean containsAll = true; ReusableEntry e = new ReusableEntry(); int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { if (!c.contains(e.with(key, (short) (entry >>> 16)))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public final boolean allContainingIn(ObjCollection<?> c) { if (isEmpty()) return true; boolean containsAll = true; ReusableEntry e = new ReusableEntry(); int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { if (!c.contains(e.with(key, (short) (entry >>> 16)))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public boolean reverseRemoveAllFrom(ObjSet<?> s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; ReusableEntry e = new ReusableEntry(); int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { changed |= s.remove(e.with(key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public final boolean reverseAddAllTo(ObjCollection<? super Map.Entry<Character, Short>> c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { changed |= c.add(new MutableEntry(mc, i, key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public boolean reverseRemoveAllFrom(ObjSet<?> s) { if (isEmpty() || s.isEmpty()) return false; boolean changed = false; ReusableEntry e = new ReusableEntry(); int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { changed |= s.remove(e.with(key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public final boolean reverseAddAllTo(ObjCollection<? super Map.Entry<Character, Short>> c) { if (isEmpty()) return false; boolean changed = false; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { changed |= c.add(new MutableEntry(mc, i, key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public final void forEach(@Nonnull Consumer<? super Map.Entry<Character, Short>> action) { if (action == null) throw new java.lang.NullPointerException(); if (isEmpty()) return; int mc = modCount(); char free = freeValue; int[] tab = table; int entry; for (int i = tab.length - 1; i >= 0; i--) { char key; if ((key = (char) (entry = tab[i])) != free) { action.accept(new MutableEntry(mc, i, key, (short) (entry >>> 16))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }