1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package extra166y; |
8 |
+ |
|
9 |
|
import jsr166y.*; |
10 |
|
import static extra166y.Ops.*; |
11 |
|
import java.util.*; |
19 |
|
* methods of ParallelArray or its other prefix classes. |
20 |
|
*/ |
21 |
|
public abstract class ParallelArrayWithFilter<T> |
22 |
< |
extends ParallelArrayWithMapping<T,T>{ |
22 |
> |
extends ParallelArrayWithMapping<T,T> { |
23 |
|
ParallelArrayWithFilter(ForkJoinPool ex, int origin, int fence, T[] array) { |
24 |
|
super(ex, origin, fence, array); |
25 |
|
} |
39 |
|
|
40 |
|
/** |
41 |
|
* Replaces elements with the results of applying the given |
42 |
< |
* op to their indices |
42 |
> |
* op to their indices. |
43 |
|
* @param op the op |
44 |
|
* @return this (to simplify use in expressions) |
45 |
|
*/ |
52 |
|
|
53 |
|
/** |
54 |
|
* Replaces elements with the results of applying the given |
55 |
< |
* mapping to each index and current element value |
55 |
> |
* mapping to each index and current element value. |
56 |
|
* @param op the op |
57 |
|
* @return this (to simplify use in expressions) |
58 |
|
*/ |
64 |
|
} |
65 |
|
|
66 |
|
/** |
67 |
< |
* Replaces elements with results of applying the given |
67 |
< |
* generator. |
67 |
> |
* Replaces elements with results of applying the given generator. |
68 |
|
* @param generator the generator |
69 |
|
* @return this (to simplify use in expressions) |
70 |
|
*/ |
88 |
|
|
89 |
|
/** |
90 |
|
* Replaces elements with results of applying |
91 |
< |
* <tt>op(thisElement, otherElement)</tt> |
91 |
> |
* {@code op(thisElement, otherElement)}. |
92 |
|
* @param other the other array |
93 |
|
* @param combiner the combiner |
94 |
|
* @return this (to simplify use in expressions) |
104 |
|
|
105 |
|
/** |
106 |
|
* Replaces elements with results of applying |
107 |
< |
* <tt>op(thisElement, otherElement)</tt> |
107 |
> |
* {@code op(thisElement, otherElement)}. |
108 |
|
* @param other the other array |
109 |
|
* @param combiner the combiner |
110 |
|
* @return this (to simplify use in expressions) |
120 |
|
/** |
121 |
|
* Returns a new ParallelArray containing only non-null unique |
122 |
|
* elements (that is, without any duplicates). This method |
123 |
< |
* uses each element's <tt>equals</tt> method to test for |
123 |
> |
* uses each element's {@code equals} method to test for |
124 |
|
* duplication. |
125 |
|
* @return the new ParallelArray |
126 |
|
*/ |
153 |
|
/** |
154 |
|
* Returns an operation prefix that causes a method to operate |
155 |
|
* only on elements for which the current selector (if |
156 |
< |
* present) and the given selector returns true |
156 |
> |
* present) and the given selector returns true. |
157 |
|
* @param selector the selector |
158 |
|
* @return operation prefix |
159 |
|
*/ |
163 |
|
/** |
164 |
|
* Returns an operation prefix that causes a method to operate |
165 |
|
* only on elements for which the current selector (if |
166 |
< |
* present) and the given binary selector returns true |
166 |
> |
* present) and the given binary selector returns true. |
167 |
|
* @param selector the selector |
168 |
|
* @return operation prefix |
169 |
|
*/ |
176 |
|
/** |
177 |
|
* Returns an operation prefix that causes a method to operate |
178 |
|
* only on elements for which the current selector (if |
179 |
< |
* present) and the given indexed selector returns true |
179 |
> |
* present) and the given indexed selector returns true. |
180 |
|
* @param selector the selector |
181 |
|
* @return operation prefix |
182 |
|
*/ |
224 |
|
|
225 |
|
final Object oget(int i) { return this.array[i]; } |
226 |
|
} |
227 |
– |
|