|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsr166z.forkjoin.ParallelIntArray.WithIntMapping jsr166z.forkjoin.ParallelIntArray.WithFilter
public abstract static class ParallelIntArray.WithFilter
A restriction of parallel array operations to apply only to elements for which a selector returns true
Method Summary | ||
---|---|---|
int |
any()
Returns some element matching bound and filter constraints |
|
void |
apply({int=>void} procedure)
Applies the given procedure |
|
int |
indexOfMax()
Returns the index corresponding to the greatest element or -1 if empty, assuming that all elements are Comparables |
|
int |
indexOfMax({int,int=>int} comparator)
Returns the index corresponding to the greatest element, or -1 if empty |
|
int |
indexOfMin()
Returns the index corresponding to the least element or -1 if empty, assuming that all elements are Comparables |
|
int |
indexOfMin({int,int=>int} comparator)
Returns the index corresponding to the least element or -1 if empty |
|
int |
max()
Returns the maximum element, or Integer.MIN_VALUE if empty assuming that all elements are Comparables |
|
int |
max({int,int=>int} comparator)
Returns the maximum element, or Integer.MIN_VALUE if empty |
|
int |
min()
Returns the minimum element, or Integer.MAX_VALUE if empty, assuming that all elements are Comparables |
|
int |
min({int,int=>int} comparator)
Returns the minimum element, or Integer.MAX_VALUE if empty |
|
abstract ParallelIntArray |
newArray()
Returns a new ParallelArray holding elements |
|
void |
randomFill()
Sets each element to a uniform random value having the same properties as Random.nextInt() |
|
void |
randomFill(int bound)
Sets each element to a uniform random value having the same properties as Random.nextInt(int) |
|
int |
reduce({int,int=>int} reducer,
int base)
Returns reduction of elements |
|
void |
replaceWithCombination(int[] other,
{int,int=>int} combiner)
Replaces elements with results of applying combine(thisElement, otherElement) |
|
void |
replaceWithCombination(ParallelIntArray other,
{int,int=>int} combiner)
Replaces elements with results of applying combine(thisElement, otherElement) |
|
void |
replaceWithGeneratedValue({=>int} generator)
Replaces elements with results of applying the given generator. |
|
void |
replaceWithMappedIndex({int=>int} mapper)
Replaces elements with the results of applying the given mapper to their indices |
|
void |
replaceWithTransform({int=>int} mapper)
Replaces elements with the results of applying the given mapper to their current values. |
|
void |
replaceWithValue(int value)
Replaces elements with the given value. |
|
int |
sum()
Returns the sum of elements |
|
abstract ParallelIntArray.WithDoubleMapping |
withMapping({int=>double} mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
|
abstract ParallelIntArray.WithIntMapping |
withMapping({int=>int} mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
|
abstract ParallelIntArray.WithLongMapping |
withMapping({int=>long} mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
|
abstract
|
withMapping({int=>U} mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
Methods inherited from class jsr166z.forkjoin.ParallelIntArray.WithIntMapping |
---|
anyIndex, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void apply({int=>void} procedure)
apply
in class ParallelIntArray.WithIntMapping
procedure
- the procedurepublic int reduce({int,int=>int} reducer, int base)
reduce
in class ParallelIntArray.WithIntMapping
reducer
- the reducerbase
- the result for an empty array
public int sum()
sum
in class ParallelIntArray.WithIntMapping
public int min({int,int=>int} comparator)
min
in class ParallelIntArray.WithIntMapping
comparator
- the comparator
public int min()
min
in class ParallelIntArray.WithIntMapping
public int max({int,int=>int} comparator)
max
in class ParallelIntArray.WithIntMapping
comparator
- the comparator
public int max()
max
in class ParallelIntArray.WithIntMapping
public int indexOfMin({int,int=>int} comparator)
indexOfMin
in class ParallelIntArray.WithIntMapping
comparator
- the comparator
public int indexOfMax({int,int=>int} comparator)
indexOfMax
in class ParallelIntArray.WithIntMapping
comparator
- the comparator
public int indexOfMin()
indexOfMin
in class ParallelIntArray.WithIntMapping
java.lang.ClassCastException
- if any element is not Comparable.public int indexOfMax()
indexOfMax
in class ParallelIntArray.WithIntMapping
java.lang.ClassCastException
- if any element is not Comparable.public abstract ParallelIntArray newArray()
newArray
in class ParallelIntArray.WithIntMapping
public void replaceWithTransform({int=>int} mapper)
mapper
- the mapperpublic void replaceWithMappedIndex({int=>int} mapper)
mapper
- the mapperpublic void replaceWithGeneratedValue({=>int} generator)
generator
- the generatorpublic void randomFill()
Random.nextInt()
public void randomFill(int bound)
Random.nextInt(int)
bound
- the upper bound of each random value
java.lang.IllegalArgumentException
- if bound less than or
equal to zeropublic void replaceWithValue(int value)
value
- the valuepublic void replaceWithCombination(ParallelIntArray other, {int,int=>int} combiner)
other
- the other arraycombiner
- the combiner
java.lang.ArrayIndexOutOfBoundsException
- if other array has
fewer than upperBound elements.public void replaceWithCombination(int[] other, {int,int=>int} combiner)
other
- the other arraycombiner
- the combiner
java.lang.ArrayIndexOutOfBoundsException
- if other array has
fewer than upperBound elements.public int any()
any
in class ParallelIntArray.WithIntMapping
java.util.NoSuchElementException
- if emptypublic abstract <U> ParallelIntArray.WithMapping<U> withMapping({int=>U} mapper)
mapper
- the mapper
public abstract ParallelIntArray.WithDoubleMapping withMapping({int=>double} mapper)
mapper
- the mapper
public abstract ParallelIntArray.WithLongMapping withMapping({int=>long} mapper)
mapper
- the mapper
public abstract ParallelIntArray.WithIntMapping withMapping({int=>int} mapper)
mapper
- the mapper
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |