|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.extra166y.AbstractParallelAnyArray groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap<T> groovyx.gpars.extra166y.ParallelArrayWithMapping<T,T> groovyx.gpars.extra166y.ParallelArrayWithFilter<T> groovyx.gpars.extra166y.ParallelArrayWithBounds<T>
public abstract class ParallelArrayWithBounds<T>
A prefix view of ParallelArray that causes operations to apply only to elements within a given range. Instances of this class may be constructed only via prefix methods of ParallelArray or its other prefix classes.
Nested Class Summary |
---|
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 | |
---|---|
ParallelArrayWithBounds(jsr166y.ForkJoinPool ex,
int origin,
int fence,
T[] array)
|
Method Summary | |
---|---|
abstract int |
binarySearch(T target)
Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present. |
abstract int |
binarySearch(T target,
java.util.Comparator<? super T> 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. |
abstract ParallelArrayWithBounds<T> |
cumulate(Ops.Reducer<T> reducer,
T base)
Replaces each element with the running cumulation of applying the given reducer. |
abstract int |
indexOf(T target)
Returns the index of some element equal to given target, or -1 if not present |
abstract T |
precumulate(Ops.Reducer<T> reducer,
T base)
Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction. |
abstract ParallelArrayWithBounds<T> |
sort()
Sorts the elements, assuming all elements are Comparable. |
abstract ParallelArrayWithBounds<T> |
sort(java.util.Comparator<? super T> cmp)
Sorts the elements. |
abstract ParallelArrayWithBounds<T> |
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). |
Methods inherited from class groovyx.gpars.extra166y.ParallelArrayWithFilter |
---|
allNonidenticalElements, allUniqueElements, hasAllEqualElements, hasAllIdenticalElements, leafTransfer, leafTransferByIndex, oget, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithMappedIndex, replaceWithMapping, replaceWithMapping, replaceWithMapping, replaceWithValue, withFilter, withFilter, withIndexedFilter |
Methods inherited from class groovyx.gpars.extra166y.ParallelArrayWithMapping |
---|
all, all, any, apply, max, max, min, min, reduce, sequentially, summary, summary, withIndexedMapping, withIndexedMapping, withIndexedMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping |
Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.OPap |
---|
dget, leafMoveByIndex, leafMoveSelected, lget, ogetArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ParallelArrayWithBounds(jsr166y.ForkJoinPool ex, int origin, int fence, T[] array)
Method Detail |
---|
public abstract ParallelArrayWithBounds<T> withBounds(int firstIndex, int upperBound)
firstIndex
- the lower bound (inclusive)upperBound
- the upper bound (exclusive)
public abstract int indexOf(T target)
target
- the element to search for
public abstract int binarySearch(T target)
target
- the element to search for
public abstract int binarySearch(T target, java.util.Comparator<? super T> comparator)
target
- the element to search forcomparator
- the comparator
public abstract ParallelArrayWithBounds<T> cumulate(Ops.Reducer<T> reducer, T base)
reducer
- the reducerbase
- the result for an empty array
public abstract T precumulate(Ops.Reducer<T> reducer, T base)
reducer
- the reducerbase
- the result for an empty array
public abstract ParallelArrayWithBounds<T> sort(java.util.Comparator<? super T> cmp)
cmp
- the comparator to use
public abstract ParallelArrayWithBounds<T> sort()
java.lang.ClassCastException
- if any element is not Comparable.
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |