org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Class ParallelArrayWithMapping

java.lang.Object
  groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap
      groovyx.gpars.extra166y.ParallelArrayWithMapping

public abstract class ParallelArrayWithMapping
extends OPap

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.


Constructor Summary
ParallelArrayWithMapping(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)

 
Method Summary
ParallelArray all()

Returns a new ParallelArray holding elements.

ParallelArray all(java.lang.Class elementType)

Returns a new ParallelArray with the given element type holding elements.

java.lang.Object any()

Returns some element matching bound and filter constraints, or null if none.

void apply(Procedure procedure)

Applies the given procedure to elements.

java.lang.Object max(java.util.Comparator comparator)

Returns the maximum element, or null if empty.

java.lang.Object max()

Returns the maximum element, or null if empty, assuming that all elements are Comparables.

java.lang.Object min(java.util.Comparator comparator)

Returns the minimum element, or null if empty.

java.lang.Object min()

Returns the minimum element, or null if empty, assuming that all elements are Comparables.

java.lang.Object reduce(Reducer reducer, java.lang.Object base)

Returns reduction of elements.

java.lang.Iterable 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.

SummaryStatistics summary(java.util.Comparator comparator)

Returns summary statistics, using the given comparator to locate minimum and maximum elements.

SummaryStatistics summary()

Returns summary statistics, assuming that all elements are Comparables.

ParallelArrayWithMapping withIndexedMapping(IntAndObjectToObject 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.

ParallelArrayWithDoubleMapping withIndexedMapping(IntAndObjectToDouble 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.

ParallelArrayWithLongMapping withIndexedMapping(IntAndObjectToLong 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.

ParallelArrayWithMapping withMapping(Op 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.

ParallelArrayWithDoubleMapping withMapping(ObjectToDouble 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.

ParallelArrayWithLongMapping withMapping(ObjectToLong 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.

ParallelArrayWithMapping withMapping(BinaryOp combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithMapping withMapping(ObjectAndDoubleToObject combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithMapping withMapping(ObjectAndLongToObject combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(ObjectAndObjectToDouble combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(ObjectAndDoubleToDouble combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithDoubleMapping withMapping(ObjectAndLongToDouble combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(ObjectAndObjectToLong combiner, ParallelArrayWithMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(ObjectAndDoubleToLong combiner, ParallelDoubleArrayWithDoubleMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

ParallelArrayWithLongMapping withMapping(ObjectAndLongToLong combiner, ParallelLongArrayWithLongMapping other)

Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.

 

Constructor Detail

ParallelArrayWithMapping

ParallelArrayWithMapping(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)


 
Method Detail

all

public ParallelArray all()
Returns a new ParallelArray holding elements.
Returns:
a new ParallelArray holding elements


all

public ParallelArray all(java.lang.Class elementType)
Returns a new ParallelArray with the given element type holding elements.
Parameters:
elementType - the type of the elements
Returns:
a new ParallelArray holding elements


any

public java.lang.Object any()
Returns some element matching bound and filter constraints, or null if none.
Returns:
an element, or null if none


apply

public void apply(Procedure procedure)
Applies the given procedure to elements.
Parameters:
procedure - the procedure


max

public java.lang.Object max(java.util.Comparator comparator)
Returns the maximum element, or null if empty.
Parameters:
comparator - the comparator
Returns:
maximum element, or null if empty


max

public java.lang.Object max()
Returns the maximum element, or null if empty, assuming that all elements are Comparables.
throws:
ClassCastException if any element is not Comparable
Returns:
maximum element, or null if empty


min

public java.lang.Object min(java.util.Comparator comparator)
Returns the minimum element, or null if empty.
Parameters:
comparator - the comparator
Returns:
minimum element, or null if empty


min

public java.lang.Object min()
Returns the minimum element, or null if empty, assuming that all elements are Comparables.
throws:
ClassCastException if any element is not Comparable
Returns:
minimum element, or null if empty


reduce

public java.lang.Object reduce(Reducer reducer, java.lang.Object base)
Returns reduction of elements.
Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
reduction


sequentially

public java.lang.Iterable 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


summary

public SummaryStatistics summary(java.util.Comparator 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 SummaryStatistics summary()
Returns summary statistics, assuming that all elements are Comparables.
Returns:
the summary


withIndexedMapping

public ParallelArrayWithMapping withIndexedMapping(IntAndObjectToObject 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 ParallelArrayWithDoubleMapping withIndexedMapping(IntAndObjectToDouble 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 ParallelArrayWithLongMapping withIndexedMapping(IntAndObjectToLong 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


withMapping

public ParallelArrayWithMapping withMapping(Op 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 ParallelArrayWithDoubleMapping withMapping(ObjectToDouble 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 ParallelArrayWithLongMapping withMapping(ObjectToLong 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 ParallelArrayWithMapping withMapping(BinaryOp combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithMapping withMapping(ObjectAndDoubleToObject combiner, ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithMapping withMapping(ObjectAndLongToObject combiner, ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(ObjectAndObjectToDouble combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(ObjectAndDoubleToDouble combiner, ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithDoubleMapping withMapping(ObjectAndLongToDouble combiner, ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(ObjectAndObjectToLong combiner, ParallelArrayWithMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(ObjectAndDoubleToLong combiner, ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


withMapping

public ParallelArrayWithLongMapping withMapping(ObjectAndLongToLong combiner, ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array.
throws:
IllegalArgumentException if other array is a filtered view (all filters must precede all mappings)
Parameters:
combiner - the combiner
other - the other array
Returns:
operation prefix


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.