@Override @Nonnull public HashObjSet<Map.Entry<Byte, Byte>> entrySet() { return new EntryView(); }
@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(); }
@Nonnull public final <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType();
@Nonnull public final <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType();
@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 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 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 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 @Nonnull public final Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = new MutableEntry(mc, i, key, (byte) (entry >>> 8)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Override @Nonnull public final Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 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) { result[resultIndex++] = new MutableEntry(mc, i, key, (byte) (entry >>> 8)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@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(); }
@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(); }
@Override public final boolean removeAll(@Nonnull Collection<?> c) { if (c instanceof InternalObjCollectionOps) { InternalObjCollectionOps c2 = (InternalObjCollectionOps) c; if (equivalence().equals(c2.equivalence()) && c2.size() < this.size()) { // noinspection unchecked c2.reverseRemoveAllFrom(this); } } throw new java.lang.UnsupportedOperationException(); }
@Override public final boolean removeAll(@Nonnull Collection<?> c) { if (c instanceof InternalObjCollectionOps) { InternalObjCollectionOps c2 = (InternalObjCollectionOps) c; if (equivalence().equals(c2.equivalence()) && c2.size() < this.size()) { // noinspection unchecked c2.reverseRemoveAllFrom(this); } } throw new java.lang.UnsupportedOperationException(); }
@Override @Nonnull public HashObjSet<Map.Entry<Byte, Byte>> entrySet() { return new EntryView(); }