/** * Sorts the array, assuming all elements are Comparable. Unlike Arrays.sort, this sort does not * guarantee that elements with equal keys maintain their relative position in the array. * * @return this (to simplify use in expressions) * @throws ClassCastException if any element is not Comparable */ public ParallelArray<T> sort() { super.sort(); return this; }
/** * Replaces each element with the running cumulation of applying the given reducer. For example, * if the contents are the numbers {@code 1, 2, 3}, and the reducer operation adds numbers, then * after invocation of this method, the contents would be {@code 1, 3, 6} (that is, {@code 1, 1+2, * 1+2+3}). * * @param reducer the reducer * @param base the result for an empty array * @return this (to simplify use in expressions) */ public ParallelArray<T> cumulate(Reducer<T> reducer, T base) { super.cumulate(reducer, base); return this; }
/** * Sorts the array. Unlike Arrays.sort, this sort does not guarantee that elements with equal keys * maintain their relative position in the array. * * @param comparator the comparator to use * @return this (to simplify use in expressions) */ public ParallelArray<T> sort(Comparator<? super T> comparator) { super.sort(comparator); return this; }
/** * Replaces elements with results of applying {@code op(thisElement, otherElement)}. * * @param other the other array * @param combiner the combiner * @return this (to simplify use in expressions) */ public <V, W> ParallelArray<T> replaceWithMapping( BinaryOp<? super T, ? super V, ? extends T> combiner, ParallelArrayWithMapping<W, V> other) { super.replaceWithMapping(combiner, other); return this; }
/** * Replaces elements with results of applying {@code op(thisElement, otherElement)}. * * @param other the other array * @param combiner the combiner * @return this (to simplify use in expressions) */ public ParallelArray<T> replaceWithMapping(BinaryOp<T, T, T> combiner, T[] other) { super.replaceWithMapping(combiner, other); return this; }
/** * Replaces elements with the given value. * * @param value the value * @return this (to simplify use in expressions) */ public ParallelArray<T> replaceWithValue(T value) { super.replaceWithValue(value); return this; }
/** * Replaces elements with the results of applying the given generator. * * @param generator the generator * @return this (to simplify use in expressions) */ public ParallelArray<T> replaceWithGeneratedValue(Generator<? extends T> generator) { super.replaceWithGeneratedValue(generator); return this; }
/** * Replaces elements with the results of applying the given mapping to each index and current * element value. * * @param op the op * @return this (to simplify use in expressions) */ public ParallelArray<T> replaceWithMappedIndex(IntAndObjectToObject<? super T, ? extends T> op) { super.replaceWithMappedIndex(op); return this; }
/** * Replaces elements with the results of applying the given transform to their current values. * * @param op the op * @return this (to simplify use in expressions) */ public ParallelArray<T> replaceWithMapping(Op<? super T, ? extends T> op) { super.replaceWithMapping(op); return this; }
/** * Applies the given procedure to elements. * * @param procedure the procedure */ public void apply(Procedure<? super T> procedure) { super.apply(procedure); }