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