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; |
139 |
|
* static final GpaField gpaField = new GpaField(); |
140 |
|
* } |
141 |
|
* </pre> |
142 |
– |
* |
142 |
|
*/ |
143 |
|
public class ParallelArray<T> extends AbstractParallelAnyArray.OUPap<T> implements Iterable<T> { |
144 |
|
/* |
272 |
|
* mapped ParallelArray. |
273 |
|
*/ |
274 |
|
public static interface SummaryStatistics<T> { |
275 |
< |
/** Return the number of elements */ |
275 |
> |
/** Returns the number of elements */ |
276 |
|
public int size(); |
277 |
< |
/** Return the minimum element, or null if empty */ |
277 |
> |
/** Returns the minimum element, or null if empty */ |
278 |
|
public T min(); |
279 |
< |
/** Return the maximum element, or null if empty */ |
279 |
> |
/** Returns the maximum element, or null if empty */ |
280 |
|
public T max(); |
281 |
< |
/** Return the index of the minimum element, or -1 if empty */ |
281 |
> |
/** Returns the index of the minimum element, or -1 if empty */ |
282 |
|
public int indexOfMin(); |
283 |
< |
/** Return the index of the maximum element, or -1 if empty */ |
283 |
> |
/** Returns the index of the maximum element, or -1 if empty */ |
284 |
|
public int indexOfMax(); |
285 |
|
} |
286 |
|
|
287 |
|
/** |
288 |
< |
* Returns the executor used for computations |
288 |
> |
* Returns the executor used for computations. |
289 |
|
* @return the executor |
290 |
|
*/ |
291 |
|
public ForkJoinPool getExecutor() { return ex; } |
662 |
|
* @param other the elements to add |
663 |
|
* @return this (to simplify use in expressions) |
664 |
|
*/ |
665 |
< |
public ParallelArray<T> addAll(T[] other) { |
665 |
> |
public ParallelArray<T> addAll(T[] other) { |
666 |
|
int csize = other.length; |
667 |
|
int end = fence; |
668 |
|
insertSlotsAt(end, csize); |
1095 |
|
} |
1096 |
|
|
1097 |
|
/** |
1098 |
< |
* Make len slots available at index |
1098 |
> |
* Makes len slots available at index. |
1099 |
|
*/ |
1100 |
|
final void insertSlotsAt(int index, int len) { |
1101 |
|
if (len <= 0) |