jsr166y.forkjoin
public abstract static class ParallelArray.WithFilter<T> extends ParallelArray.WithMapping<T,T>
Modifier and Type | Method and Description |
---|---|
abstract ParallelArray<T> |
allNonidenticalElements()
Returns a new ParallelArray containing only non-null unique
elements (that is, without any duplicates).
|
abstract ParallelArray<T> |
allUniqueElements()
Returns a new ParallelArray containing only non-null unique
elements (that is, without any duplicates).
|
void |
apply(Ops.Procedure<? super T> procedure)
Applies the given procedure to elements
|
T |
max()
Returns the maximum element, or null if empty
assuming that all elements are Comparables
|
T |
max(java.util.Comparator<? super T> comparator)
Returns the maximum element, or null if empty
|
T |
min()
Returns the minimum element, or null if empty,
assuming that all elements are Comparables
|
T |
min(java.util.Comparator<? super T> comparator)
Returns the minimum element, or null if empty
|
abstract ParallelArray.WithFilter<T> |
orFilter(Ops.Predicate<? super T> 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
|
T |
reduce(Ops.Reducer<T> reducer,
T base)
Returns reduction of elements
|
abstract void |
removeAll()
Removes from the array all elements matching bound and/or
filter constraints.
|
void |
replaceWithCombination(ParallelArray.WithBounds<? extends T> other,
Ops.Reducer<T> combiner)
Replaces elements with results of applying
combine(thisElement, otherElement)
|
void |
replaceWithCombination(ParallelArray<? extends T> other,
Ops.Reducer<T> combiner)
Replaces elements with results of applying
combine(thisElement, otherElement)
|
void |
replaceWithCombination(T[] other,
Ops.Reducer<T> combiner)
Replaces elements with results of applying
combine(thisElement, otherElement)
|
void |
replaceWithGeneratedValue(Ops.Generator<? extends T> generator)
Replaces elements with results of applying the given
generator.
|
void |
replaceWithMappedIndex(Ops.MapperFromInt<? extends T> mapper)
Replaces elements with the results of applying the given
mapper to their indices
|
void |
replaceWithTransform(Ops.Mapper<? super T,? extends T> mapper)
Replaces elements with the results of applying the given
mapper to their current values.
|
void |
replaceWithValue(T value)
Replaces elements with the given value.
|
ParallelArray.SummaryStatistics<T> |
summary()
Returns summary statistics, assuming that all elements are
Comparables
|
ParallelArray.SummaryStatistics<T> |
summary(java.util.Comparator<? super T> comparator)
Returns summary statistics, using the given comparator
to locate minimum and maximum elements.
|
abstract ParallelArray.WithFilter<T> |
withFilter(Ops.Predicate<? super T> 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
|
all, all, any, anyIndex, size, withMapping, withMapping, withMapping
public void apply(Ops.Procedure<? super T> procedure)
ParallelArray.WithMapping
apply
in class ParallelArray.WithMapping<T,T>
procedure
- the procedurepublic T reduce(Ops.Reducer<T> reducer, T base)
ParallelArray.WithMapping
reduce
in class ParallelArray.WithMapping<T,T>
reducer
- the reducerbase
- the result for an empty arraypublic T min(java.util.Comparator<? super T> comparator)
ParallelArray.WithMapping
min
in class ParallelArray.WithMapping<T,T>
comparator
- the comparatorpublic T min()
ParallelArray.WithMapping
min
in class ParallelArray.WithMapping<T,T>
public T max(java.util.Comparator<? super T> comparator)
ParallelArray.WithMapping
max
in class ParallelArray.WithMapping<T,T>
comparator
- the comparatorpublic T max()
ParallelArray.WithMapping
max
in class ParallelArray.WithMapping<T,T>
public ParallelArray.SummaryStatistics<T> summary(java.util.Comparator<? super T> comparator)
ParallelArray.WithMapping
summary
in class ParallelArray.WithMapping<T,T>
comparator
- the comparator to use for
locating minimum and maximum elementspublic ParallelArray.SummaryStatistics<T> summary()
ParallelArray.WithMapping
summary
in class ParallelArray.WithMapping<T,T>
public void replaceWithTransform(Ops.Mapper<? super T,? extends T> mapper)
mapper
- the mapperpublic void replaceWithMappedIndex(Ops.MapperFromInt<? extends T> mapper)
mapper
- the mapperpublic void replaceWithGeneratedValue(Ops.Generator<? extends T> generator)
generator
- the generatorpublic void replaceWithValue(T value)
value
- the valuepublic void replaceWithCombination(ParallelArray<? extends T> other, Ops.Reducer<T> combiner)
other
- the other arraycombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other array has
fewer than upperBound elements.public void replaceWithCombination(ParallelArray.WithBounds<? extends T> other, Ops.Reducer<T> combiner)
other
- the other array segmentcombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other array has
fewer than upperBound elements.public void replaceWithCombination(T[] other, Ops.Reducer<T> combiner)
other
- the other arraycombiner
- the combinerjava.lang.ArrayIndexOutOfBoundsException
- if other array has
fewer than upperBound elements.public abstract void removeAll()
public abstract ParallelArray<T> allUniqueElements()
public abstract ParallelArray<T> allNonidenticalElements()
public abstract ParallelArray.WithFilter<T> withFilter(Ops.Predicate<? super T> selector)
selector
- the selectorpublic abstract ParallelArray.WithFilter<T> orFilter(Ops.Predicate<? super T> selector)
selector
- the selector