jsr166z.forkjoin
Class ParallelLongArray.WithDoubleMapping

java.lang.Object
  extended by jsr166z.forkjoin.ParallelLongArray.WithDoubleMapping
Enclosing class:
ParallelLongArray

public abstract static class ParallelLongArray.WithDoubleMapping
extends java.lang.Object

A modifier for parallel array operations to apply to mappings of elements to doubles, not to the elements themselves


Method Summary
abstract  double any()
          Returns mapping of some element matching bound and filter constraints
abstract  int anyIndex()
          Returns the index of some element matching bound and filter constraints, or -1 if none.
 void apply({double=>void} procedure)
          Applies the given procedure
 int indexOfMax()
          Returns the index corresponding to the element for which the given mapping is greatest, or -1 if empty
 int indexOfMax({double,double=>int} comparator)
          Returns the index corresponding to the element for which the given mapping is greatest, or -1 if empty
 int indexOfMin()
          Returns the index corresponding to the element for which the given mapping is least, or -1 if empty
 int indexOfMin({double,double=>int} comparator)
          Returns the index corresponding to the element for which the given mapping is least, or -1 if empty
 double max()
          Returns the maximum element, or -Double.MAX_VALUE if empty
 double max({double,double=>int} comparator)
          Returns the maximum element, or -Double.MAX_VALUE if empty
 double min()
          Returns the minimum element, or Double.MAX_VALUE if empty
 double min({double,double=>int} comparator)
          Returns the minimum element, or Double.MAX_VALUE if empty
abstract  ParallelDoubleArray newArray()
          Returns a new ParallelDoubleArray holding mappings
 double reduce({double,double=>double} reducer, double base)
          Returns reduction of mapped elements
abstract  int size()
          Return the number of elements selected using bound or filter restrictions.
 double sum()
          Returns the sum of mapped elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

apply

public void apply({double=>void} procedure)
Applies the given procedure

Parameters:
procedure - the procedure

reduce

public double reduce({double,double=>double} reducer,
                     double base)
Returns reduction of mapped elements

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

min

public double min()
Returns the minimum element, or Double.MAX_VALUE if empty

Returns:
minimum element, or Double.MAX_VALUE if empty

min

public double min({double,double=>int} comparator)
Returns the minimum element, or Double.MAX_VALUE if empty

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

max

public double max()
Returns the maximum element, or -Double.MAX_VALUE if empty

Returns:
maximum element, or -Double.MAX_VALUE if empty

max

public double max({double,double=>int} comparator)
Returns the maximum element, or -Double.MAX_VALUE if empty

Parameters:
comparator - the comparator
Returns:
maximum element, or -Double.MAX_VALUE if empty

sum

public double sum()
Returns the sum of mapped elements

Returns:
the sum of mapped elements

indexOfMin

public int indexOfMin()
Returns the index corresponding to the element for which the given mapping is least, or -1 if empty

Returns:
the index of least element or -1 if empty.

indexOfMax

public int indexOfMax()
Returns the index corresponding to the element for which the given mapping is greatest, or -1 if empty

Returns:
the index of greatest element or -1 if empty.

indexOfMin

public int indexOfMin({double,double=>int} comparator)
Returns the index corresponding to the element for which the given mapping is least, or -1 if empty

Parameters:
comparator - the comparator
Returns:
the index of least element or -1 if empty.

indexOfMax

public int indexOfMax({double,double=>int} comparator)
Returns the index corresponding to the element for which the given mapping is greatest, or -1 if empty

Parameters:
comparator - the comparator
Returns:
the index of greatest element or -1 if empty.

newArray

public abstract ParallelDoubleArray newArray()
Returns a new ParallelDoubleArray holding mappings

Returns:
a new ParallelDoubleArray holding mappings

size

public abstract int size()
Return the number of elements selected using bound or filter restrictions. Note that this method must evaluate all selectors to return its result.

Returns:
the number of elements

anyIndex

public abstract int anyIndex()
Returns the index of some element matching bound and filter constraints, or -1 if none.

Returns:
index of matching element, or -1 if none.

any

public abstract double any()
Returns mapping of some element matching bound and filter constraints

Returns:
mapping of matching element
Throws:
java.util.NoSuchElementException - if empty