jsr166y.forkjoin
public static final class ParallelLongArray.WithBounds extends ParallelLongArray.WithFilter
Modifier and Type | Method and Description |
---|---|
ParallelLongArray |
all()
Returns a new ParallelLongArray holding elements
|
ParallelLongArray |
allUniqueElements()
Returns a new ParallelLongArray 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(long target)
Assuming this array is sorted, returns the index of an
element equal to given target, or -1 if not present.
|
int |
binarySearch(long target,
Ops.LongComparator 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.
|
ParallelLongArray |
combine(long[] other,
Ops.LongReducer combiner)
Returns a ParallelLongArray containing results of
applying combine(thisElement, otherElement)
for each element.
|
<U,V> ParallelLongArray |
combine(ParallelLongArray.WithBounds other,
Ops.LongReducer combiner)
Returns a ParallelLongArray containing results of
applying combine(thisElement, otherElement)
for each element.
|
ParallelLongArray |
combine(ParallelLongArray other,
Ops.LongReducer combiner)
Returns a ParallelLongArray containing results of
applying combine(thisElement, otherElement)
for each element.
|
void |
cumulate(Ops.LongReducer reducer,
long base)
Replaces each element with the running cumulation of applying
the given reducer.
|
void |
cumulateSum()
Replaces each element with the running sum
|
int |
indexOf(long target)
Returns the index of some element equal to given target, or
-1 if not present
|
ParallelLongArray.WithFilter |
orFilter(Ops.LongPredicate 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
|
long |
precumulate(Ops.LongReducer reducer,
long base)
Replaces each element with the cumulation of applying the given
reducer to all previous values, and returns the total
reduction.
|
long |
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()
Return the number of elements selected using bound or
filter restrictions.
|
void |
sort()
Sorts the elements, assuming all elements are
Comparable.
|
void |
sort(Ops.LongComparator cmp)
Sorts the elements.
|
ParallelLongArray.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).
|
ParallelLongArray.WithFilter |
withFilter(Ops.LongPredicate selector)
Returns an operation prefix that causes a method to operate
only on elements for which the current selector (if
present) and the given selector returns true
|
ParallelLongArray.WithLongMapping |
withMapping(Ops.LongMapper mapper)
Returns an operation prefix that causes a method to operate
on mapped elements of the array using the given mapper.
|
<U> ParallelLongArray.WithMapping<U> |
withMapping(Ops.MapperFromLong<? extends U> mapper)
Returns an operation prefix that causes a method to operate
on mapped elements of the array using the given mapper.
|
ParallelLongArray.WithDoubleMapping |
withMapping(Ops.MapperFromLongToDouble mapper)
Returns an operation prefix that causes a method to operate
on mapped elements of the array using the given mapper.
|
replaceWithCombination, replaceWithCombination, replaceWithCombination, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithTransform, replaceWithValue
public ParallelLongArray.WithBounds withBounds(int firstIndex, int upperBound)
firstIndex
- the lower bound (inclusive)upperBound
- the upper bound (exclusive)public ParallelLongArray.WithFilter withFilter(Ops.LongPredicate selector)
ParallelLongArray.WithFilter
withFilter
in class ParallelLongArray.WithFilter
selector
- the selectorpublic <U> ParallelLongArray.WithMapping<U> withMapping(Ops.MapperFromLong<? extends U> mapper)
ParallelLongArray.WithLongMapping
withMapping
in class ParallelLongArray.WithLongMapping
mapper
- the mapperpublic ParallelLongArray.WithLongMapping withMapping(Ops.LongMapper mapper)
ParallelLongArray.WithLongMapping
withMapping
in class ParallelLongArray.WithLongMapping
mapper
- the mapperpublic ParallelLongArray.WithDoubleMapping withMapping(Ops.MapperFromLongToDouble mapper)
ParallelLongArray.WithLongMapping
withMapping
in class ParallelLongArray.WithLongMapping
mapper
- the mapperpublic ParallelLongArray.WithFilter orFilter(Ops.LongPredicate selector)
ParallelLongArray.WithFilter
orFilter
in class ParallelLongArray.WithFilter
selector
- the selectorpublic int anyIndex()
ParallelLongArray.WithLongMapping
anyIndex
in class ParallelLongArray.WithLongMapping
public ParallelLongArray combine(long[] other, Ops.LongReducer combiner)
other
- the other arraycombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other array is
shorter than this array.public ParallelLongArray combine(ParallelLongArray other, Ops.LongReducer combiner)
other
- the other arraycombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other array is
shorter than this array.public <U,V> ParallelLongArray combine(ParallelLongArray.WithBounds other, Ops.LongReducer combiner)
other
- the other array segmentcombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other segment is
shorter than this array.public ParallelLongArray all()
ParallelLongArray.WithLongMapping
all
in class ParallelLongArray.WithLongMapping
public ParallelLongArray allUniqueElements()
ParallelLongArray.WithFilter
allUniqueElements
in class ParallelLongArray.WithFilter
public int indexOf(long target)
target
- the element to search forpublic int binarySearch(long target)
target
- the element to search forpublic int binarySearch(long target, Ops.LongComparator comparator)
target
- the element to search forcomparator
- the comparatorpublic int size()
ParallelLongArray.WithLongMapping
size
in class ParallelLongArray.WithLongMapping
public void cumulate(Ops.LongReducer reducer, long base)
reducer
- the reducerbase
- the result for an empty arraypublic void cumulateSum()
public long precumulate(Ops.LongReducer reducer, long base)
reducer
- the reducerbase
- the result for an empty arraypublic long precumulateSum()
public void sort(Ops.LongComparator cmp)
cmp
- the comparator to usepublic void sort()
java.lang.ClassCastException
- if any element is not Comparable.public void removeAll()
ParallelLongArray.WithFilter
removeAll
in class ParallelLongArray.WithFilter
public void removeConsecutiveDuplicates()