@Nonnull public double[] toDoubleArray() { int size = size(); double[] result = new double[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Nonnull public double[] toDoubleArray() { int size = size(); double[] result = new double[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@SuppressWarnings("unchecked") @Nonnull public <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[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { a[resultIndex++] = (T) Double.valueOf(Double.longBitsToDouble(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
@SuppressWarnings("unchecked") @Nonnull public <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[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { a[resultIndex++] = (T) Double.valueOf(Double.longBitsToDouble(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
public String setToString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { sb.append(' ').append(Double.longBitsToDouble(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(); }
@Nonnull public double[] toArray(double[] a) { int size = size(); if (a.length < size) a = new double[size]; if (size == 0) { if (a.length > 0) a[0] = 0.0; return a; } int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { a[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = 0.0; return a; }
public String setToString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { sb.append(' ').append(Double.longBitsToDouble(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(); }
@Nonnull public double[] toArray(double[] a) { int size = size(); if (a.length < size) a = new double[size]; if (size == 0) { if (a.length > 0) a[0] = 0.0; return a; } int resultIndex = 0; int mc = modCount(); long[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { long key; if ((key = keys[i]) < FREE_BITS) { a[resultIndex++] = Double.longBitsToDouble(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = 0.0; return a; }