org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Class ParallelLongArrayWithMapping

java.lang.Object
  AbstractParallelAnyArray.LPap
      groovyx.gpars.extra166y.ParallelLongArrayWithMapping

public abstract class ParallelLongArrayWithMapping
extends LPap

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.


Constructor Summary
ParallelLongArrayWithMapping(ForkJoinPool ex, int origin, int fence, long[] array)

 
Method Summary
ParallelArray all()

Returns a new ParallelArray holding mapped elements

ParallelArray all(java.lang.Class elementType)

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

java.lang.Object any()

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

void apply(Procedure procedure)

Applies the given procedure to mapped elements

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

Returns the maximum mapped element, or null if empty

java.lang.Object max()

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

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

Returns the minimum mapped element, or null if empty

java.lang.Object min()

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

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

Returns reduction of mapped 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

ParallelLongArrayWithMapping 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.

ParallelLongArrayWithDoubleMapping 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.

ParallelLongArrayWithLongMapping 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.

ParallelLongArrayWithMapping 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

ParallelLongArrayWithLongMapping 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

ParallelLongArrayWithDoubleMapping 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

ParallelLongArrayWithMapping 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.

ParallelLongArrayWithMapping 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.

ParallelLongArrayWithMapping 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.

ParallelLongArrayWithDoubleMapping 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.

ParallelLongArrayWithDoubleMapping 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.

ParallelLongArrayWithDoubleMapping 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.

ParallelLongArrayWithLongMapping 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.

ParallelLongArrayWithLongMapping 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.

ParallelLongArrayWithLongMapping 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

ParallelLongArrayWithMapping

ParallelLongArrayWithMapping(ForkJoinPool ex, int origin, int fence, long[] array)


 
Method Detail

all

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


all

public ParallelArray all(java.lang.Class 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


any

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


apply

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


max

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


max

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


min

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


min

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


reduce

public java.lang.Object reduce(Reducer reducer, java.lang.Object base)
Returns reduction of mapped 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 ParallelLongArrayWithMapping 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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithLongMapping 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 ParallelLongArrayWithMapping 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 ParallelLongArrayWithLongMapping 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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithMapping 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 ParallelLongArrayWithMapping 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 ParallelLongArrayWithMapping 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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithDoubleMapping 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 ParallelLongArrayWithLongMapping 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 ParallelLongArrayWithLongMapping 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 ParallelLongArrayWithLongMapping 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–2012 Václav Pech. All Rights Reserved.