Package extra166y
Class ParallelArrayWithMapping<T,U>
java.lang.Object
extra166y.AbstractParallelAnyArray
extra166y.ParallelArrayWithMapping<T,U>
- Direct Known Subclasses:
ParallelArrayWithFilter
A prefix view of ParallelArray that causes operations to apply
to mappings of elements, not to the elements themselves.
Instances of this class may be constructed only via prefix
methods of ParallelArray or its other prefix classes.
-
Method Summary
Modifier and TypeMethodDescriptionall()
Returns a new ParallelArray holding elementsReturns a new ParallelArray with the given element type holding elementsany()
Returns some element matching bound and filter constraints, or null if none.void
apply
(Ops.Procedure<? super U> procedure) Applies the given procedure to elementsmax()
Returns the maximum element, or null if empty assuming that all elements are Comparablesmax
(Comparator<? super U> comparator) Returns the maximum element, or null if emptymin()
Returns the minimum element, or null if empty, assuming that all elements are Comparablesmin
(Comparator<? super U> comparator) Returns the minimum element, or null if emptyreduce
(Ops.Reducer<U> reducer, U base) Returns reduction of elementsReturns an Iterable view to sequentially step through mapped elements also obeying bound and filter constraints, without performing computations to evaluate them in parallelsummary()
Returns summary statistics, assuming that all elements are Comparablessummary
(Comparator<? super U> comparator) Returns summary statistics, using the given comparator to locate minimum and maximum elements.abstract ParallelArrayWithDoubleMapping
<T> withIndexedMapping
(Ops.IntAndObjectToDouble<? super U> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.abstract ParallelArrayWithLongMapping
<T> withIndexedMapping
(Ops.IntAndObjectToLong<? super U> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.abstract <V> ParallelArrayWithMapping
<T, V> withIndexedMapping
(Ops.IntAndObjectToObject<? super U, ? extends V> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.<V,
W, X> ParallelArrayWithMapping <T, W> withMapping
(Ops.BinaryOp<? super U, ? super V, ? extends W> combiner, ParallelArrayWithMapping<X, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.ObjectAndDoubleToDouble<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.ObjectAndDoubleToLong<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V> ParallelArrayWithMapping
<T, V> withMapping
(Ops.ObjectAndDoubleToObject<? super U, ? extends V> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.ObjectAndLongToDouble<? super U> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.withMapping
(Ops.ObjectAndLongToLong<? super U> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V> ParallelArrayWithMapping
<T, V> withMapping
(Ops.ObjectAndLongToObject<? super U, ? extends V> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V,
W> ParallelArrayWithDoubleMapping <T> withMapping
(Ops.ObjectAndObjectToDouble<? super U, ? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.<V,
W> ParallelArrayWithLongMapping <T> withMapping
(Ops.ObjectAndObjectToLong<? super U, ? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.abstract ParallelArrayWithDoubleMapping
<T> withMapping
(Ops.ObjectToDouble<? super U> op) Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's resultsabstract ParallelArrayWithLongMapping
<T> withMapping
(Ops.ObjectToLong<? super U> op) Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's resultsabstract <V> ParallelArrayWithMapping
<T, V> withMapping
(Ops.Op<? super U, ? extends V> op) Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's resultsMethods inherited from class extra166y.AbstractParallelAnyArray
anyIndex, isEmpty, size
-
Method Details
-
apply
Applies the given procedure to elements- Parameters:
procedure
- the procedure
-
reduce
Returns reduction of elements- Parameters:
reducer
- the reducerbase
- the result for an empty array- Returns:
- reduction
-
any
Returns some element matching bound and filter constraints, or null if none.- Returns:
- an element, or null if none.
-
min
Returns the minimum element, or null if empty- Parameters:
comparator
- the comparator- Returns:
- minimum element, or null if empty
-
min
Returns the minimum element, or null if empty, assuming that all elements are Comparables- Returns:
- minimum element, or null if empty
- Throws:
ClassCastException
- if any element is not Comparable.
-
max
Returns the maximum element, or null if empty- Parameters:
comparator
- the comparator- Returns:
- maximum element, or null if empty
-
max
Returns the maximum element, or null if empty assuming that all elements are Comparables- Returns:
- maximum element, or null if empty
- Throws:
ClassCastException
- if any element is not Comparable.
-
summary
Returns summary statistics, using the given comparator to locate minimum and maximum elements.- Parameters:
comparator
- the comparator to use for locating minimum and maximum elements- Returns:
- the summary.
-
summary
Returns summary statistics, assuming that all elements are Comparables- Returns:
- the summary.
-
all
Returns a new ParallelArray holding elements- Returns:
- a new ParallelArray holding elements
-
all
Returns a new ParallelArray with the given element type holding elements- Parameters:
elementType
- the type of the elements- Returns:
- a new ParallelArray holding elements
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op applied to current op's results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
public <V,W, ParallelArrayWithMapping<T,X> W> withMapping(Ops.BinaryOp<? super U, ? super V, ? extends W> combiner, ParallelArrayWithMapping<X, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.ObjectAndDoubleToObject<? super U, ? extends V> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.ObjectAndLongToObject<? super U, ? extends V> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V,W> ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndObjectToDouble<? super U, ? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndDoubleToDouble<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndLongToDouble<? super U> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V,W> ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndObjectToLong<? super U, ? super V> combiner, ParallelArrayWithMapping<W, V> other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndDoubleToLong<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndLongToLong<? super U> combiner, ParallelLongArrayWithLongMapping other) Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.- Parameters:
combiner
- the combinerother
- the other array- Returns:
- operation prefix
- Throws:
IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withIndexedMapping
public abstract <V> ParallelArrayWithMapping<T,V> withIndexedMapping(Ops.IntAndObjectToObject<? super U, ? extends V> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
withIndexedMapping
public abstract ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndObjectToDouble<? super U> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
withIndexedMapping
public abstract ParallelArrayWithLongMapping<T> withIndexedMapping(Ops.IntAndObjectToLong<? super U> mapper) Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value (as mapped by preceding mappings, if any), and produces a new value.- Parameters:
mapper
- the mapper- Returns:
- operation prefix
-
sequentially
Returns an Iterable view to sequentially step through mapped elements also obeying bound and filter constraints, without performing computations to evaluate them in parallel- Returns:
- the Iterable view
-