public abstract class ParallelArrayWithBounds<T> extends ParallelArrayWithFilter<T>
Modifier and Type | Method and Description |
---|---|
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,
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(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).
|
allNonidenticalElements, allUniqueElements, hasAllEqualElements, hasAllIdenticalElements, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithMappedIndex, replaceWithMapping, replaceWithMapping, replaceWithMapping, replaceWithValue, withFilter, withFilter, withIndexedFilter
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
anyIndex, isEmpty, size
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 forpublic abstract int binarySearch(T target)
target
- the element to search forpublic abstract int binarySearch(T target, Comparator<? super T> comparator)
target
- the element to search forcomparator
- the comparatorpublic abstract ParallelArrayWithBounds<T> cumulate(Ops.Reducer<T> reducer, T base)
reducer
- the reducerbase
- the result for an empty arraypublic abstract T precumulate(Ops.Reducer<T> reducer, T base)
reducer
- the reducerbase
- the result for an empty arraypublic abstract ParallelArrayWithBounds<T> sort(Comparator<? super T> cmp)
cmp
- the comparator to usepublic abstract ParallelArrayWithBounds<T> sort()
ClassCastException
- if any element is not Comparable.