groovyx.gpars.extra166y
Class ParallelArrayWithLongMapping<T>

java.lang.Object
  extended by groovyx.gpars.extra166y.AbstractParallelAnyArray
      extended by groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap<T>
          extended by groovyx.gpars.extra166y.ParallelArrayWithLongMapping<T>
Direct Known Subclasses:
AbstractParallelAnyArray.OLCPap, AbstractParallelAnyArray.OLMPap

public abstract class ParallelArrayWithLongMapping<T>
extends AbstractParallelAnyArray.OPap<T>

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
 
Nested classes/interfaces inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
AbstractParallelAnyArray.AndPredicate<T>, AbstractParallelAnyArray.DDCPap, AbstractParallelAnyArray.DDMPap, AbstractParallelAnyArray.DFDCPap, AbstractParallelAnyArray.DFDMPap, AbstractParallelAnyArray.DFLCPap, AbstractParallelAnyArray.DFLMPap, AbstractParallelAnyArray.DFOCPap<U>, AbstractParallelAnyArray.DFOMPap<U>, AbstractParallelAnyArray.DFPap, AbstractParallelAnyArray.DLCPap, AbstractParallelAnyArray.DLMPap, AbstractParallelAnyArray.DOCPap<U>, AbstractParallelAnyArray.DOMPap<U>, AbstractParallelAnyArray.DPap, AbstractParallelAnyArray.DRDCPap, AbstractParallelAnyArray.DRDMPap, AbstractParallelAnyArray.DRLCPap, AbstractParallelAnyArray.DRLMPap, AbstractParallelAnyArray.DROCPap<U>, AbstractParallelAnyArray.DROMPap<U>, AbstractParallelAnyArray.DRPap, AbstractParallelAnyArray.DUDCPap, AbstractParallelAnyArray.DUDMPap, AbstractParallelAnyArray.DULCPap, AbstractParallelAnyArray.DULMPap, AbstractParallelAnyArray.DUOCPap<U>, AbstractParallelAnyArray.DUOMPap<U>, AbstractParallelAnyArray.DUPap, AbstractParallelAnyArray.FilteredAsDoubleIterator, AbstractParallelAnyArray.FilteredAsLongIterator, AbstractParallelAnyArray.FilteredIterator<U>, AbstractParallelAnyArray.LDCPap, AbstractParallelAnyArray.LDMPap, AbstractParallelAnyArray.LFDCPap, AbstractParallelAnyArray.LFDMPap, AbstractParallelAnyArray.LFLCPap, AbstractParallelAnyArray.LFLMPap, AbstractParallelAnyArray.LFOCPap<U>, AbstractParallelAnyArray.LFOMPap<U>, AbstractParallelAnyArray.LFPap, AbstractParallelAnyArray.LLCPap, AbstractParallelAnyArray.LLMPap, AbstractParallelAnyArray.LOCPap<U>, AbstractParallelAnyArray.LOMPap<U>, AbstractParallelAnyArray.LPap, AbstractParallelAnyArray.LRDCPap, AbstractParallelAnyArray.LRDMPap, AbstractParallelAnyArray.LRLCPap, AbstractParallelAnyArray.LRLMPap, AbstractParallelAnyArray.LROCPap<U>, AbstractParallelAnyArray.LROMPap<U>, AbstractParallelAnyArray.LRPap, AbstractParallelAnyArray.LUDCPap, AbstractParallelAnyArray.LUDMPap, AbstractParallelAnyArray.LULCPap, AbstractParallelAnyArray.LULMPap, AbstractParallelAnyArray.LUOCPap<U>, AbstractParallelAnyArray.LUOMPap<U>, AbstractParallelAnyArray.LUPap, AbstractParallelAnyArray.ODCPap<T>, AbstractParallelAnyArray.ODMPap<T>, AbstractParallelAnyArray.OFDCPap<T>, AbstractParallelAnyArray.OFDMPap<T>, AbstractParallelAnyArray.OFLCPap<T>, AbstractParallelAnyArray.OFLMPap<T>, AbstractParallelAnyArray.OFOCPap<T,U>, AbstractParallelAnyArray.OFOMPap<T,U>, AbstractParallelAnyArray.OFPap<T>, AbstractParallelAnyArray.OLCPap<T>, AbstractParallelAnyArray.OLMPap<T>, AbstractParallelAnyArray.OOCPap<T,U>, AbstractParallelAnyArray.OOMPap<T,U>, AbstractParallelAnyArray.OPap<T>, AbstractParallelAnyArray.ORDCPap<T>, AbstractParallelAnyArray.ORDMPap<T>, AbstractParallelAnyArray.ORLCPap<T>, AbstractParallelAnyArray.ORLMPap<T>, AbstractParallelAnyArray.OROCPap<T,U>, AbstractParallelAnyArray.OROMPap<T,U>, AbstractParallelAnyArray.ORPap<T>, AbstractParallelAnyArray.OUDCPap<T>, AbstractParallelAnyArray.OUDMPap<T>, AbstractParallelAnyArray.OULCPap<T>, AbstractParallelAnyArray.OULMPap<T>, AbstractParallelAnyArray.OUOCPap<T,U>, AbstractParallelAnyArray.OUOMPap<T,U>, AbstractParallelAnyArray.OUPap<T>, AbstractParallelAnyArray.Sequentially<U>, AbstractParallelAnyArray.SequentiallyAsDouble, AbstractParallelAnyArray.SequentiallyAsLong, AbstractParallelAnyArray.UnfilteredAsDoubleIterator, AbstractParallelAnyArray.UnfilteredAsLongIterator, AbstractParallelAnyArray.UnfilteredIterator<U>
 
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
ParallelArrayWithLongMapping(jsr166y.ForkJoinPool ex, int origin, int fence, T[] array)
           
 
Method Summary
 ParallelLongArray all()
          Returns a new ParallelLongArray holding mappings
 void apply(Ops.LongProcedure procedure)
          Applies the given procedure
 long max()
          Returns the maximum element, or Long.MIN_VALUE if empty
 long max(Ops.LongComparator comparator)
          Returns the maximum element, or Long.MIN_VALUE if empty
 long min()
          Returns the minimum element, or Long.MAX_VALUE if empty
 long min(Ops.LongComparator comparator)
          Returns the minimum element, or Long.MAX_VALUE if empty
 long reduce(Ops.LongReducer reducer, long base)
          Returns reduction of mapped elements
 java.lang.Iterable<java.lang.Long> 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
 long sum()
          Returns the sum of elements
 ParallelLongArray.SummaryStatistics summary()
          Returns summary statistics, using natural comparator
 ParallelLongArray.SummaryStatistics summary(Ops.LongComparator comparator)
          Returns summary statistics
abstract  ParallelArrayWithDoubleMapping<T> withIndexedMapping(Ops.IntAndLongToDouble 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.IntAndLongToLong 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.IntAndLongToObject<? 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.
 ParallelArrayWithLongMapping<T> withMapping(Ops.BinaryLongOp combiner, ParallelLongArrayWithLongMapping 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.LongAndDoubleToDouble 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.LongAndDoubleToLong 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.LongAndDoubleToObject<? 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.LongAndLongToDouble 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.LongAndLongToObject<? 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.LongAndObjectToDouble<? 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.LongAndObjectToLong<? 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,X> ParallelArrayWithMapping<T,W>
withMapping(Ops.LongAndObjectToObject<? 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.
abstract  ParallelArrayWithLongMapping<T> withMapping(Ops.LongOp op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.
abstract  ParallelArrayWithDoubleMapping<T> withMapping(Ops.LongToDouble op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.
abstract
<U> ParallelArrayWithMapping<T,U>
withMapping(Ops.LongToObject<? extends U> op)
          Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.
 
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap
dget, leafMoveByIndex, leafMoveSelected, lget, ogetArray
 
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray
allDoubles, allLongs, allObjects, anyIndex, boundsCheck, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedOp, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, compoundIndexedSelector, computeThreshold, dgetArray, getThreshold, hasFilter, hasMap, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedMapper, indexedSelector, indexedSelector, indexedSelector, isEmpty, isSelected, leafApply, leafApply, leafApply, leafBinaryIndexMap, leafBinaryIndexMap, leafBinaryIndexMap, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafCombineInPlace, leafFill, leafFill, leafFill, leafGenerate, leafGenerate, leafGenerate, leafIndexMap, leafIndexMap, leafIndexMap, leafIndexSelected, leafReduce, leafReduce, leafReduce, leafTransfer, leafTransfer, leafTransfer, leafTransferByIndex, leafTransferByIndex, leafTransferByIndex, leafTransform, leafTransform, leafTransform, lgetArray, oget, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelArrayWithLongMapping

ParallelArrayWithLongMapping(jsr166y.ForkJoinPool ex,
                             int origin,
                             int fence,
                             T[] array)
Method Detail

apply

public void apply(Ops.LongProcedure procedure)
Applies the given procedure

Parameters:
procedure - the procedure

reduce

public long reduce(Ops.LongReducer reducer,
                   long base)
Returns reduction of mapped elements

Parameters:
reducer - the reducer
base - the result for an empty array
Returns:
reduction

min

public long min()
Returns the minimum element, or Long.MAX_VALUE if empty

Returns:
minimum element, or Long.MAX_VALUE if empty

min

public long min(Ops.LongComparator comparator)
Returns the minimum element, or Long.MAX_VALUE if empty

Parameters:
comparator - the comparator
Returns:
minimum element, or Long.MAX_VALUE if empty

max

public long max()
Returns the maximum element, or Long.MIN_VALUE if empty

Returns:
maximum element, or Long.MIN_VALUE if empty

max

public long max(Ops.LongComparator comparator)
Returns the maximum element, or Long.MIN_VALUE if empty

Parameters:
comparator - the comparator
Returns:
maximum element, or Long.MIN_VALUE if empty

sum

public long sum()
Returns the sum of elements

Returns:
the sum of elements

summary

public ParallelLongArray.SummaryStatistics summary(Ops.LongComparator comparator)
Returns summary statistics

Parameters:
comparator - the comparator to use for locating minimum and maximum elements
Returns:
the summary.

summary

public ParallelLongArray.SummaryStatistics summary()
Returns summary statistics, using natural comparator

Returns:
the summary.

all

public ParallelLongArray all()
Returns a new ParallelLongArray holding mappings

Returns:
a new ParallelLongArray holding mappings

withMapping

public abstract ParallelArrayWithDoubleMapping<T> withMapping(Ops.LongToDouble op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

Parameters:
op - the op
Returns:
operation prefix

withMapping

public abstract ParallelArrayWithLongMapping<T> withMapping(Ops.LongOp op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

Parameters:
op - the op
Returns:
operation prefix

withMapping

public abstract <U> ParallelArrayWithMapping<T,U> withMapping(Ops.LongToObject<? extends U> op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op.

Parameters:
op - the op
Returns:
operation prefix

withMapping

public <V,W,X> ParallelArrayWithMapping<T,W> withMapping(Ops.LongAndObjectToObject<? 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 combiner
other - 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> ParallelArrayWithMapping<T,V> withMapping(Ops.LongAndDoubleToObject<? 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 combiner
other - 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> ParallelArrayWithMapping<T,V> withMapping(Ops.LongAndLongToObject<? 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 combiner
other - 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> ParallelArrayWithDoubleMapping<T> withMapping(Ops.LongAndObjectToDouble<? 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 combiner
other - 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 ParallelArrayWithDoubleMapping<T> withMapping(Ops.LongAndDoubleToDouble 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 combiner
other - 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 ParallelArrayWithDoubleMapping<T> withMapping(Ops.LongAndLongToDouble 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 combiner
other - 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> ParallelArrayWithLongMapping<T> withMapping(Ops.LongAndObjectToLong<? 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 combiner
other - 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 ParallelArrayWithLongMapping<T> withMapping(Ops.LongAndDoubleToLong 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 combiner
other - 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 ParallelArrayWithLongMapping<T> withMapping(Ops.BinaryLongOp 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 combiner
other - 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> ParallelArrayWithMapping<T,V> withIndexedMapping(Ops.IntAndLongToObject<? 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.IntAndLongToDouble 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.IntAndLongToLong 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<java.lang.Long> 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

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