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.13 by jsr166, Fri Feb 15 22:27:11 2013 UTC vs.
Revision 1.18 by jsr166, Sun Jan 18 20:17:32 2015 UTC

# Line 5 | Line 5
5   */
6  
7   package extra166y;
8 +
9   import jsr166y.*;
10   import static extra166y.Ops.*;
11   import java.util.*;
# Line 133 | Line 134 | import java.lang.reflect.Array;
134   *     public boolean op(Student s) { return s.credits > 90; }
135   *   }
136   *   static final IsSenior isSenior = new IsSenior();
137 < *   static final class GpaField implements ObjectToDouble&lt;Student&gt {
137 > *   static final class GpaField implements ObjectToDouble&lt;Student&gt; {
138   *     public double op(Student s) { return s.gpa; }
139   *   }
140   *   static final GpaField gpaField = new GpaField();
# Line 526 | Line 527 | public class ParallelArray<T> extends Ab
527       * 2, 3}, and the reducer operation adds numbers, then after
528       * invocation of this method, the contents would be {@code 0, 1,
529       * 3} (that is, {@code 0, 0+1, 0+1+2}, and the return value
530 <     * would be 6 (that is, {@code  1+2+3}).
530 >     * would be 6 (that is, {@code 1+2+3}).
531       * @param reducer the reducer
532       * @param base the result for an empty array
533       * @return the total reduction
# Line 551 | Line 552 | public class ParallelArray<T> extends Ab
552       * Sorts the array, assuming all elements are Comparable. Unlike
553       * Arrays.sort, this sort does not guarantee that elements
554       * with equal keys maintain their relative position in the array.
554     * @throws ClassCastException if any element is not Comparable
555       * @return this (to simplify use in expressions)
556 +     * @throws ClassCastException if any element is not Comparable
557       */
558      public ParallelArray<T> sort() {
559          super.sort();
# Line 1352 | Line 1353 | public class ParallelArray<T> extends Ab
1353              return a;
1354          }
1355  
1356 <        public <V> V[] toArray(V a[]) {
1356 >        public <V> V[] toArray(V[] a) {
1357              int len = fence;
1358              if (a.length < len) {
1359                  Class elementType = a.getClass().getComponentType();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines