ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/extra166y/ParallelArray.java
(Generate patch)

Comparing jsr166/src/extra166y/ParallelArray.java (file contents):
Revision 1.3 by jsr166, Mon Dec 5 04:08:47 2011 UTC vs.
Revision 1.6 by jsr166, Sun Nov 18 18:03:10 2012 UTC

# Line 22 | Line 22 | import java.lang.reflect.Array;
22   * matching a predicate or ranges of indices, and to <em>reduce</em>
23   * all elements into a single value such as a sum.
24   *
25 < * <p> A ParallelArray is constructed by allocating, using, or copying
25 > * <p>A ParallelArray is constructed by allocating, using, or copying
26   * an array, using one of the static factory methods {@link #create},
27   * {@link #createEmpty}, {@link #createUsingHandoff} and {@link
28   * #createFromCopy}. Upon construction, the encapsulated array managed
# Line 31 | Line 31 | import java.lang.reflect.Array;
31   * array, access by another thread of an element of a ParallelArray
32   * while another operation is in progress has undefined effects.
33   *
34 < * <p> The ForkJoinPool used to construct a ParallelArray can be
34 > * <p>The ForkJoinPool used to construct a ParallelArray can be
35   * shared safely by other threads (and used in other
36   * ParallelArrays). To avoid the overhead associated with creating
37   * multiple executors, it is often a good idea to use the {@link
# Line 67 | Line 67 | import java.lang.reflect.Array;
67   * significantly improving performance beyond that of the Long and
68   * Double versions.)
69   *
70 < * <p> Most usages of ParallelArray involve sets of operations prefixed
70 > * <p>Most usages of ParallelArray involve sets of operations prefixed
71   * with range bounds, filters, and mappings (including mappings that
72   * combine elements from other ParallelArrays), using
73   * <tt>withBounds</tt>, <tt>withFilter</tt>, and <tt>withMapping</tt>,
# Line 139 | Line 139 | import java.lang.reflect.Array;
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      /*
# Line 273 | Line 272 | public class ParallelArray<T> extends Ab
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; }
# Line 1096 | Line 1095 | public class ParallelArray<T> extends Ab
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines