|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsr166y.forkjoin.ParallelDoubleArray.WithDoubleMapping
jsr166y.forkjoin.ParallelDoubleArray.WithFilter
jsr166y.forkjoin.ParallelDoubleArray.WithBounds
public static final class ParallelDoubleArray.WithBounds
A restriction of parallel array operations to apply only within a given range of indices.
Method Summary | ||
---|---|---|
ParallelDoubleArray |
all()
Returns a new ParallelDoubleArray holding elements |
|
ParallelDoubleArray |
allUniqueElements()
Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates). |
|
int |
anyIndex()
Returns the index of some element matching bound and filter constraints, or -1 if none. |
|
int |
binarySearch(double target)
Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present. |
|
int |
binarySearch(double target,
Ops.DoubleComparator comparator)
Assuming this array is sorted with respect to the given comparator, returns the index of an element equal to given target, or -1 if not present. |
|
ParallelDoubleArray |
combine(double[] other,
Ops.DoubleReducer combiner)
Returns a ParallelDoubleArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(ParallelDoubleArray.WithBounds other,
Ops.DoubleReducer combiner)
Returns a ParallelDoubleArray containing results of applying combine(thisElement, otherElement) for each element. |
|
ParallelDoubleArray |
combine(ParallelDoubleArray other,
Ops.DoubleReducer combiner)
Returns a ParallelDoubleArray containing results of applying combine(thisElement, otherElement) for each element. |
|
void |
cumulate(Ops.DoubleReducer reducer,
double base)
Replaces each element with the running cumulation of applying the given reducer. |
|
void |
cumulateSum()
Replaces each element with the running sum |
|
int |
indexOf(double target)
Returns the index of some element equal to given target, or -1 if not present |
|
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 |
|
double |
precumulate(Ops.DoubleReducer reducer,
double base)
Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction. |
|
double |
precumulateSum()
Replaces each element with its prefix sum |
|
void |
removeAll()
Removes from the array all elements matching bound and/or filter constraints. |
|
void |
removeConsecutiveDuplicates()
Removes consecutive elements that are equal (or null), shifting others leftward, and possibly decreasing size. |
|
int |
size()
Returns the number of elements within bounds |
|
void |
sort()
Sorts the elements, assuming all elements are Comparable. |
|
void |
sort(Ops.DoubleComparator cmp)
Sorts the elements. |
|
ParallelDoubleArray.WithBounds |
withBounds(int firstIndex,
int upperBound)
Returns an operation prefix that causes a method to operate only on the elements of the array between firstIndex (inclusive) and upperBound (exclusive). |
|
ParallelDoubleArray.WithFilter |
withFilter(Ops.DoublePredicate selector)
Returns an operation prefix that causes a method to operate only on the elements of the array for which the given selector returns true |
|
ParallelDoubleArray.WithDoubleMapping |
withMapping(Ops.DoubleMapper mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
|
|
withMapping(Ops.MapperFromDouble<? extends U> mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper. |
|
ParallelDoubleArray.WithLongMapping |
withMapping(Ops.MapperFromDoubleToLong 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 jsr166y.forkjoin.ParallelDoubleArray.WithFilter |
---|
replaceWithCombination, replaceWithCombination, replaceWithCombination, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithTransform, replaceWithValue |
Methods inherited from class jsr166y.forkjoin.ParallelDoubleArray.WithDoubleMapping |
---|
apply, max, max, min, min, reduce, sum, summary, summary |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ParallelDoubleArray.WithBounds withBounds(int firstIndex, int upperBound)
firstIndex
- the lower bound (inclusive)upperBound
- the upper bound (exclusive)
public ParallelDoubleArray.WithFilter withFilter(Ops.DoublePredicate selector)
withFilter
in class ParallelDoubleArray.WithFilter
selector
- the selector
public <U> ParallelDoubleArray.WithMapping<U> withMapping(Ops.MapperFromDouble<? extends U> mapper)
withMapping
in class ParallelDoubleArray.WithDoubleMapping
mapper
- the mapper
public ParallelDoubleArray.WithDoubleMapping withMapping(Ops.DoubleMapper mapper)
withMapping
in class ParallelDoubleArray.WithDoubleMapping
mapper
- the mapper
public ParallelDoubleArray.WithLongMapping withMapping(Ops.MapperFromDoubleToLong mapper)
withMapping
in class ParallelDoubleArray.WithDoubleMapping
mapper
- the mapper
public ParallelDoubleArray.WithFilter orFilter(Ops.DoublePredicate selector)
ParallelDoubleArray.WithFilter
orFilter
in class ParallelDoubleArray.WithFilter
selector
- the selector
public int anyIndex()
ParallelDoubleArray.WithDoubleMapping
anyIndex
in class ParallelDoubleArray.WithDoubleMapping
public ParallelDoubleArray combine(double[] other, Ops.DoubleReducer combiner)
other
- the other arraycombiner
- the combiner
java.lang.ArrayIndexOutOfBoundsException
- if other array is
shorter than this array.public ParallelDoubleArray combine(ParallelDoubleArray other, Ops.DoubleReducer combiner)
other
- the other arraycombiner
- the combiner
java.lang.ArrayIndexOutOfBoundsException
- if other array is
shorter than this array.public <U,V> ParallelDoubleArray combine(ParallelDoubleArray.WithBounds other, Ops.DoubleReducer combiner)
other
- the other array segmentcombiner
- the combiner
java.lang.ArrayIndexOutOfBoundsException
- if other segment is
shorter than this array.public ParallelDoubleArray all()
ParallelDoubleArray.WithDoubleMapping
all
in class ParallelDoubleArray.WithDoubleMapping
public ParallelDoubleArray allUniqueElements()
ParallelDoubleArray.WithFilter
allUniqueElements
in class ParallelDoubleArray.WithFilter
public int indexOf(double target)
target
- the element to search for
public int binarySearch(double target)
target
- the element to search for
public int binarySearch(double target, Ops.DoubleComparator comparator)
target
- the element to search forcomparator
- the comparator
public int size()
size
in class ParallelDoubleArray.WithDoubleMapping
public void cumulate(Ops.DoubleReducer reducer, double base)
reducer
- the reducerbase
- the result for an empty arraypublic void cumulateSum()
public double precumulate(Ops.DoubleReducer reducer, double base)
reducer
- the reducerbase
- the result for an empty array
public double precumulateSum()
public void sort(Ops.DoubleComparator cmp)
cmp
- the comparator to usepublic void sort()
java.lang.ClassCastException
- if any element is not Comparable.public void removeAll()
ParallelDoubleArray.WithFilter
removeAll
in class ParallelDoubleArray.WithFilter
public void removeConsecutiveDuplicates()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |