jsr166y.forkjoin
Class ParallelDoubleArray.WithFilter

java.lang.Object
  extended by jsr166y.forkjoin.ParallelDoubleArray.WithDoubleMapping
      extended by jsr166y.forkjoin.ParallelDoubleArray.WithFilter
Direct Known Subclasses:
ParallelDoubleArray.WithBounds
Enclosing class:
ParallelDoubleArray

public abstract static class ParallelDoubleArray.WithFilter
extends ParallelDoubleArray.WithDoubleMapping

A restriction of parallel array operations to apply only to elements for which a selector returns true


Method Summary
abstract  ParallelDoubleArray allUniqueElements()
          Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).
abstract  ParallelDoubleArray.WithFilter orFilter(Ops.DoublePredicate selector)
          Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) or the given selector returns true
abstract  void removeAll()
          Removes from the array all elements matching bound and/or filter constraints.
 void replaceWithCombination(double[] other, Ops.DoubleReducer combiner)
          Replaces elements with results of applying combine(thisElement, otherElement)
 void replaceWithCombination(ParallelDoubleArray.WithBounds other, Ops.DoubleReducer combiner)
          Replaces elements with results of applying combine(thisElement, otherElement)
 void replaceWithCombination(ParallelDoubleArray other, Ops.DoubleReducer combiner)
          Replaces elements with results of applying combine(thisElement, otherElement)
 void replaceWithGeneratedValue(Ops.DoubleGenerator generator)
          Replaces elements with results of applying the given generator.
 void replaceWithMappedIndex(Ops.MapperFromIntToDouble mapper)
          Replaces elements with the results of applying the given mapper to their indices
 void replaceWithTransform(Ops.DoubleMapper mapper)
          Replaces elements with the results of applying the given mapper to their current values.
 void replaceWithValue(double value)
          Replaces elements with the given value.
abstract  ParallelDoubleArray.WithFilter withFilter(Ops.DoublePredicate selector)
          Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns true
 
Methods inherited from class jsr166y.forkjoin.ParallelDoubleArray.WithDoubleMapping
all, anyIndex, apply, max, max, min, min, reduce, size, sum, summary, summary, withMapping, withMapping, withMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceWithTransform

public void replaceWithTransform(Ops.DoubleMapper mapper)
Replaces elements with the results of applying the given mapper to their current values.

Parameters:
mapper - the mapper

replaceWithMappedIndex

public void replaceWithMappedIndex(Ops.MapperFromIntToDouble mapper)
Replaces elements with the results of applying the given mapper to their indices

Parameters:
mapper - the mapper

replaceWithGeneratedValue

public void replaceWithGeneratedValue(Ops.DoubleGenerator generator)
Replaces elements with results of applying the given generator.

Parameters:
generator - the generator

replaceWithValue

public void replaceWithValue(double value)
Replaces elements with the given value.

Parameters:
value - the value

replaceWithCombination

public void replaceWithCombination(ParallelDoubleArray other,
                                   Ops.DoubleReducer combiner)
Replaces elements with results of applying combine(thisElement, otherElement)

Parameters:
other - the other array
combiner - the combiner
Throws:
java.lang.ArrayIndexOutOfBoundsException - if other array has fewer than upperBound elements.

replaceWithCombination

public void replaceWithCombination(ParallelDoubleArray.WithBounds other,
                                   Ops.DoubleReducer combiner)
Replaces elements with results of applying combine(thisElement, otherElement)

Parameters:
other - the other array segment
combiner - the combiner
Throws:
java.lang.ArrayIndexOutOfBoundsException - if other array has fewer than upperBound elements.

replaceWithCombination

public void replaceWithCombination(double[] other,
                                   Ops.DoubleReducer combiner)
Replaces elements with results of applying combine(thisElement, otherElement)

Parameters:
other - the other array
combiner - the combiner
Throws:
java.lang.ArrayIndexOutOfBoundsException - if other array has fewer than upperBound elements.

removeAll

public abstract void removeAll()
Removes from the array all elements matching bound and/or filter constraints.


allUniqueElements

public abstract ParallelDoubleArray allUniqueElements()
Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).

Returns:
the new ParallelDoubleArray

withFilter

public abstract ParallelDoubleArray.WithFilter withFilter(Ops.DoublePredicate selector)
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns true

Parameters:
selector - the selector
Returns:
operation prefix

orFilter

public abstract ParallelDoubleArray.WithFilter orFilter(Ops.DoublePredicate selector)
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) or the given selector returns true

Parameters:
selector - the selector
Returns:
operation prefix