@Override public String toString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { sb.append(' '); sb.append(Double.longBitsToDouble(key)); sb.append('='); sb.append(tab[i + 1]); 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(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { sb.append(' '); sb.append(Double.longBitsToDouble(key)); sb.append('='); sb.append(tab[i + 1]); 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 @SuppressWarnings("unchecked") @Nonnull public final <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType(); a = (T[]) java.lang.reflect.Array.newInstance(elementType, size); } if (size == 0) { if (a.length > 0) a[0] = null; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { a[resultIndex++] = (T) new MutableEntry(mc, i, key, tab[i + 1]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
@Override @SuppressWarnings("unchecked") @Nonnull public final <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType(); a = (T[]) java.lang.reflect.Array.newInstance(elementType, size); } if (size == 0) { if (a.length > 0) a[0] = null; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { a[resultIndex++] = (T) new MutableEntry(mc, i, key, tab[i + 1]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
@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(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { result[resultIndex++] = new MutableEntry(mc, i, key, tab[i + 1]); } } 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(); long[] tab = table; for (int i = tab.length - 2; i >= 0; i -= 2) { long key; if ((key = tab[i]) < FREE_BITS) { result[resultIndex++] = new MutableEntry(mc, i, key, tab[i + 1]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@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(); }