/** * Creates a new tree set copying the elements of an array. * * @param a * an array to be copied into the new tree set. */ public FloatAVLTreeSet(final float[] a) { this(); int i = a.length; while (i-- != 0) add(a[i]); } /**
/** * Creates a new tree set copying the elements of an array using a given * {@link Comparator}. * * @param a * an array to be copied into the new tree set. * @param c * a {@link Comparator} (even better, a type-specific comparator). */ public FloatAVLTreeSet(final float[] a, final Comparator<? super Float> c) { this(c); int i = a.length; while (i-- != 0) add(a[i]); } /*
@Override public boolean add(final float k) { if (!in(k)) throw new IllegalArgumentException("Element (" + k + ") out of range [" + (bottom ? "-" : String.valueOf(from)) + ", " + (top ? "-" : String.valueOf(to)) + ")"); return FloatAVLTreeSet.this.add(k); }
/** * Creates a new tree set and fills it with the elements of a given array using * a given {@link Comparator}. * * @param a * an array whose elements will be used to fill the set. * @param offset * the first element to use. * @param length * the number of elements to use. * @param c * a {@link Comparator} (even better, a type-specific comparator). */ public FloatAVLTreeSet(final float[] a, final int offset, final int length, final Comparator<? super Float> c) { this(c); FloatArrays.ensureOffsetLength(a, offset, length); for (int i = 0; i < length; i++) add(a[offset + i]); } /**
/** * Creates a new tree set using elements provided by a type-specific iterator. * * @param i * a type-specific iterator whose elements will fill the set. */ public FloatAVLTreeSet(final FloatIterator i) { while (i.hasNext()) add(i.nextFloat()); } /**