|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjsr166y.forkjoin.ParallelArray.WithMapping<T,T>
jsr166y.forkjoin.ParallelArray.WithFilter<T>
jsr166y.forkjoin.ParallelArray.WithBounds<T>
public static final class ParallelArray.WithBounds<T>
A restriction of parallel array operations to apply only within a given range of indices.
| Method Summary | ||
|---|---|---|
ParallelArray<T> |
all()
Returns a new ParallelArray holding elements |
|
ParallelArray<T> |
all(java.lang.Class<? super T> elementType)
Returns a new ParallelArray with the given element type holding elements |
|
ParallelArray<T> |
allNonidenticalElements()
Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates). |
|
ParallelArray<T> |
allUniqueElements()
Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates). |
|
T |
any()
Returns some element matching bound and filter constraints, or null if none. |
|
int |
anyIndex()
Returns the index of some element matching bound and filter constraints, or -1 if none. |
|
int |
binarySearch(T target)
Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present. |
|
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. |
|
|
combine(ParallelArray.WithBounds<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(ParallelArray.WithBounds<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(ParallelArray<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(ParallelArray<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(U[] other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
|
combine(U[] other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
Returns a ParallelArray containing results of applying combine(thisElement, otherElement) for each element. |
|
void |
cumulate(Ops.Reducer<T> reducer,
T base)
Replaces each element with the running cumulation of applying the given reducer. |
|
int |
indexOf(T target)
Returns the index of some element equal to given target, or -1 if not present |
|
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 |
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. |
|
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. |
|
void |
removeNulls()
Removes null elements, 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(java.util.Comparator<? super T> cmp)
Sorts the elements. |
|
ParallelArray.WithBounds<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). |
|
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 |
|
|
withMapping(Ops.Mapper<? super T,? extends U> mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper applied to current mapper's results |
|
ParallelArray.WithDoubleMapping<T> |
withMapping(Ops.MapperToDouble<? super T> mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper applied to current mapper's results |
|
ParallelArray.WithLongMapping<T> |
withMapping(Ops.MapperToLong<? super T> mapper)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given mapper applied to current mapper's results |
|
| Methods inherited from class jsr166y.forkjoin.ParallelArray.WithFilter |
|---|
apply, max, max, min, min, reduce, replaceWithCombination, replaceWithCombination, replaceWithCombination, replaceWithGeneratedValue, replaceWithMappedIndex, replaceWithTransform, replaceWithValue, summary, summary |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public ParallelArray.WithBounds<T> withBounds(int firstIndex,
int upperBound)
firstIndex - the lower bound (inclusive)upperBound - the upper bound (exclusive)
public ParallelArray.WithFilter<T> withFilter(Ops.Predicate<? super T> selector)
ParallelArray.WithFilter
withFilter in class ParallelArray.WithFilter<T>selector - the selector
public <U> ParallelArray.WithMapping<T,U> withMapping(Ops.Mapper<? super T,? extends U> mapper)
ParallelArray.WithMapping
withMapping in class ParallelArray.WithMapping<T,T>mapper - the mapper
public ParallelArray.WithDoubleMapping<T> withMapping(Ops.MapperToDouble<? super T> mapper)
ParallelArray.WithMapping
withMapping in class ParallelArray.WithMapping<T,T>mapper - the mapper
public ParallelArray.WithLongMapping<T> withMapping(Ops.MapperToLong<? super T> mapper)
ParallelArray.WithMapping
withMapping in class ParallelArray.WithMapping<T,T>mapper - the mapper
public ParallelArray.WithFilter<T> orFilter(Ops.Predicate<? super T> selector)
ParallelArray.WithFilter
orFilter in class ParallelArray.WithFilter<T>selector - the selector
public int anyIndex()
ParallelArray.WithMapping
anyIndex in class ParallelArray.WithMapping<T,T>public T any()
ParallelArray.WithMapping
any in class ParallelArray.WithMapping<T,T>
public <U,V> ParallelArray<V> combine(U[] other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
other - the other arraycombiner - the combiner
java.lang.ArrayIndexOutOfBoundsException - if other array is
shorter than this array.
public <U,V> ParallelArray<V> combine(U[] other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
other - the other arraycombiner - the combinerelementType - the type of elements of returned array
java.lang.ArrayIndexOutOfBoundsException - if other array is
shorter than this array.
public <U,V> ParallelArray<V> combine(ParallelArray<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
other - the other arraycombiner - the combiner
java.lang.ArrayIndexOutOfBoundsException - if other array is
shorter than this array.
public <U,V> ParallelArray<V> combine(ParallelArray<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
other - the other arraycombiner - the combinerelementType - the type of elements of returned array
java.lang.ArrayIndexOutOfBoundsException - if other array is
shorter than this array.
public <U,V> ParallelArray<V> combine(ParallelArray.WithBounds<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner)
other - the other array segmentcombiner - the combiner
java.lang.ArrayIndexOutOfBoundsException - if other segment is
shorter than this array.
public <U,V> ParallelArray<V> combine(ParallelArray.WithBounds<? extends U> other,
Ops.Combiner<? super T,? super U,? extends V> combiner,
java.lang.Class<? super V> elementType)
other - the other array segmentcombiner - the combinerelementType - the type of elements of returned array
java.lang.ArrayIndexOutOfBoundsException - if other array is
shorter than this array.public ParallelArray<T> all()
ParallelArray.WithMapping
all in class ParallelArray.WithMapping<T,T>public ParallelArray<T> all(java.lang.Class<? super T> elementType)
ParallelArray.WithMapping
all in class ParallelArray.WithMapping<T,T>elementType - the type of the elements
public ParallelArray<T> allUniqueElements()
ParallelArray.WithFilter
allUniqueElements in class ParallelArray.WithFilter<T>public ParallelArray<T> allNonidenticalElements()
ParallelArray.WithFilter
allNonidenticalElements in class ParallelArray.WithFilter<T>public int indexOf(T target)
target - the element to search for
public int binarySearch(T target)
target - the element to search for
public int binarySearch(T target,
java.util.Comparator<? super T> comparator)
target - the element to search forcomparator - the comparator
public int size()
ParallelArray.WithMapping
size in class ParallelArray.WithMapping<T,T>
public void cumulate(Ops.Reducer<T> reducer,
T base)
reducer - the reducerbase - the result for an empty array
public T precumulate(Ops.Reducer<T> reducer,
T base)
reducer - the reducerbase - the result for an empty array
public void sort(java.util.Comparator<? super T> cmp)
cmp - the comparator to usepublic void sort()
java.lang.ClassCastException - if any element is not Comparable.public void removeAll()
ParallelArray.WithFilter
removeAll in class ParallelArray.WithFilter<T>public void removeConsecutiveDuplicates()
public void removeNulls()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||