|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.extra166y.AbstractParallelAnyArray groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap<T> groovyx.gpars.extra166y.ParallelArrayWithMapping<T,U>
public abstract class ParallelArrayWithMapping<T,U>
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.
Nested Class Summary |
---|
Field Summary |
---|
Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap |
---|
array |
Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray |
---|
ex, fence, origin, threshold |
Constructor Summary | |
---|---|
ParallelArrayWithMapping(jsr166y.ForkJoinPool ex,
int origin,
int fence,
T[] array)
|
Method Summary | ||
---|---|---|
ParallelArray<U> |
all()
Returns a new ParallelArray holding elements |
|
ParallelArray<U> |
all(java.lang.Class<? super U> elementType)
Returns a new ParallelArray with the given element type holding elements |
|
U |
any()
Returns some element matching bound and filter constraints, or null if none. |
|
void |
apply(Ops.Procedure<? super U> procedure)
Applies the given procedure to elements |
|
U |
max()
Returns the maximum element, or null if empty assuming that all elements are Comparables |
|
U |
max(java.util.Comparator<? super U> comparator)
Returns the maximum element, or null if empty |
|
U |
min()
Returns the minimum element, or null if empty, assuming that all elements are Comparables |
|
U |
min(java.util.Comparator<? super U> comparator)
Returns the minimum element, or null if empty |
|
U |
reduce(Ops.Reducer<U> reducer,
U base)
Returns reduction of elements |
|
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 |
|
ParallelArray.SummaryStatistics<U> |
summary()
Returns summary statistics, assuming that all elements are Comparables |
|
ParallelArray.SummaryStatistics<U> |
summary(java.util.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
|
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. |
|
|
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. |
|
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. |
|
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. |
|
|
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. |
|
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. |
|
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. |
|
|
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. |
|
|
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. |
|
|
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 results |
|
abstract 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 results |
|
abstract
|
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 groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap |
---|
dget, leafMoveByIndex, leafMoveSelected, lget, ogetArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ParallelArrayWithMapping(jsr166y.ForkJoinPool ex, int origin, int fence, T[] array)
Method Detail |
---|
public void apply(Ops.Procedure<? super U> procedure)
procedure
- the procedurepublic U reduce(Ops.Reducer<U> reducer, U base)
reducer
- the reducerbase
- the result for an empty array
public U any()
public U min(java.util.Comparator<? super U> comparator)
comparator
- the comparator
public U min()
java.lang.ClassCastException
- if any element is not Comparable.public U max(java.util.Comparator<? super U> comparator)
comparator
- the comparator
public U max()
java.lang.ClassCastException
- if any element is not Comparable.public ParallelArray.SummaryStatistics<U> summary(java.util.Comparator<? super U> comparator)
comparator
- the comparator to use for
locating minimum and maximum elements
public ParallelArray.SummaryStatistics<U> summary()
public ParallelArray<U> all()
public ParallelArray<U> all(java.lang.Class<? super U> elementType)
elementType
- the type of the elements
public abstract <V> ParallelArrayWithMapping<T,V> withMapping(Ops.Op<? super U,? extends V> op)
op
- the op
public abstract ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectToDouble<? super U> op)
op
- the op
public abstract ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectToLong<? super U> op)
op
- the op
public <V,W,X> ParallelArrayWithMapping<T,W> withMapping(Ops.BinaryOp<? super U,? super V,? extends W> combiner, ParallelArrayWithMapping<X,V> other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.ObjectAndDoubleToObject<? super U,? extends V> combiner, ParallelDoubleArrayWithDoubleMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public <V> ParallelArrayWithMapping<T,V> withMapping(Ops.ObjectAndLongToObject<? super U,? extends V> combiner, ParallelLongArrayWithLongMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public <V,W> ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndObjectToDouble<? super U,? super V> combiner, ParallelArrayWithMapping<W,V> other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndDoubleToDouble<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public ParallelArrayWithDoubleMapping<T> withMapping(Ops.ObjectAndLongToDouble<? super U> combiner, ParallelLongArrayWithLongMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public <V,W> ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndObjectToLong<? super U,? super V> combiner, ParallelArrayWithMapping<W,V> other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndDoubleToLong<? super U> combiner, ParallelDoubleArrayWithDoubleMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public ParallelArrayWithLongMapping<T> withMapping(Ops.ObjectAndLongToLong<? super U> combiner, ParallelLongArrayWithLongMapping other)
combiner
- the combinerother
- the other array
java.lang.IllegalArgumentException
- if other array is a
filtered view (all filters must precede all mappings).public abstract <V> ParallelArrayWithMapping<T,V> withIndexedMapping(Ops.IntAndObjectToObject<? super U,? extends V> mapper)
mapper
- the mapper
public abstract ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndObjectToDouble<? super U> mapper)
mapper
- the mapper
public abstract ParallelArrayWithLongMapping<T> withIndexedMapping(Ops.IntAndObjectToLong<? super U> mapper)
mapper
- the mapper
public java.lang.Iterable<U> sequentially()
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |