Package extra166y
Class ParallelLongArrayWithMapping<U>
- java.lang.Object
-
- extra166y.AbstractParallelAnyArray
-
- extra166y.ParallelLongArrayWithMapping<U>
-
public abstract class ParallelLongArrayWithMapping<U> extends AbstractParallelAnyArray
A prefix view of ParallelLongArray 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 ParallelLongArray or its other prefix classes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ParallelArray<U>
all()
Returns a new ParallelArray holding mapped elementsParallelArray<U>
all(java.lang.Class<? super U> elementType)
Returns a new ParallelArray with the given element type holding all elementsU
any()
Returns mapping of some element matching bound and filter constraints, or null if none.void
apply(Ops.Procedure<? super U> procedure)
Applies the given procedure to mapped elementsU
max()
Returns the maximum mapped element, or null if empty assuming that all elements are ComparablesU
max(java.util.Comparator<? super U> comparator)
Returns the maximum mapped element, or null if emptyU
min()
Returns the minimum mapped element, or null if empty, assuming that all elements are ComparablesU
min(java.util.Comparator<? super U> comparator)
Returns the minimum mapped element, or null if emptyU
reduce(Ops.Reducer<U> reducer, U base)
Returns reduction of mapped elementsjava.lang.Iterable<U>
sequentially()
Returns an Iterable view to sequentially step through mapped elements also obeying bound and filter constraints, without performing computations to evaluate them in parallelParallelArray.SummaryStatistics<U>
summary()
Returns summary statistics, assuming that all elements are ComparablesParallelArray.SummaryStatistics<U>
summary(java.util.Comparator<? super U> comparator)
Returns summary statistics, using the given comparator to locate minimum and maximum elements.abstract ParallelLongArrayWithDoubleMapping
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 ParallelLongArrayWithLongMapping
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> ParallelLongArrayWithMapping<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>
ParallelLongArrayWithMapping<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.ParallelLongArrayWithDoubleMapping
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.ParallelLongArrayWithLongMapping
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> ParallelLongArrayWithMapping<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.ParallelLongArrayWithDoubleMapping
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.ParallelLongArrayWithLongMapping
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> ParallelLongArrayWithMapping<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>
ParallelLongArrayWithDoubleMappingwithMapping(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>
ParallelLongArrayWithLongMappingwithMapping(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 ParallelLongArrayWithDoubleMapping
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 ParallelLongArrayWithLongMapping
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> ParallelLongArrayWithMapping<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 results-
Methods inherited from class extra166y.AbstractParallelAnyArray
anyIndex, isEmpty, size
-
-
-
-
Method Detail
-
apply
public void apply(Ops.Procedure<? super U> procedure)
Applies the given procedure to mapped elements- Parameters:
procedure
- the procedure
-
reduce
public U reduce(Ops.Reducer<U> reducer, U base)
Returns reduction of mapped elements- Parameters:
reducer
- the reducerbase
- the result for an empty array- Returns:
- reduction
-
any
public U any()
Returns mapping of some element matching bound and filter constraints, or null if none.- Returns:
- mapping of matching element, or null if none.
-
min
public U min(java.util.Comparator<? super U> comparator)
Returns the minimum mapped element, or null if empty- Parameters:
comparator
- the comparator- Returns:
- minimum mapped element, or null if empty
-
min
public U min()
Returns the minimum mapped element, or null if empty, assuming that all elements are Comparables- Returns:
- minimum mapped element, or null if empty
- Throws:
java.lang.ClassCastException
- if any element is not Comparable.
-
max
public U max(java.util.Comparator<? super U> comparator)
Returns the maximum mapped element, or null if empty- Parameters:
comparator
- the comparator- Returns:
- maximum mapped element, or null if empty
-
max
public U max()
Returns the maximum mapped element, or null if empty assuming that all elements are Comparables- Returns:
- maximum mapped element, or null if empty
- Throws:
java.lang.ClassCastException
- if any element is not Comparable.
-
summary
public ParallelArray.SummaryStatistics<U> summary(java.util.Comparator<? super U> comparator)
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
public ParallelArray.SummaryStatistics<U> summary()
Returns summary statistics, assuming that all elements are Comparables- Returns:
- the summary.
-
all
public ParallelArray<U> all()
Returns a new ParallelArray holding mapped elements- Returns:
- a new ParallelArray holding mapped elements
-
all
public ParallelArray<U> all(java.lang.Class<? super U> elementType)
Returns a new ParallelArray with the given element type holding all elements- Parameters:
elementType
- the type of the elements- Returns:
- a new ParallelArray holding all elements
-
withMapping
public abstract <V> ParallelLongArrayWithMapping<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 results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
public abstract ParallelLongArrayWithLongMapping 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 results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
public abstract ParallelLongArrayWithDoubleMapping 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 results- Parameters:
op
- the op- Returns:
- operation prefix
-
withMapping
public <V,W,X> ParallelLongArrayWithMapping<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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V> ParallelLongArrayWithMapping<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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V> ParallelLongArrayWithMapping<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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V,W> ParallelLongArrayWithDoubleMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelLongArrayWithDoubleMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelLongArrayWithDoubleMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public <V,W> ParallelLongArrayWithLongMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelLongArrayWithLongMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withMapping
public ParallelLongArrayWithLongMapping 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:
java.lang.IllegalArgumentException
- if other array is a filtered view (all filters must precede all mappings).
-
withIndexedMapping
public abstract <V> ParallelLongArrayWithMapping<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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithLongMapping 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
public java.lang.Iterable<U> 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
-
-