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

Comparing jsr166/src/extra166y/ParallelLongArray.java (file contents):
Revision 1.1 by dl, Tue Jan 6 14:30:58 2009 UTC vs.
Revision 1.6 by jsr166, Wed Jul 4 20:13:53 2012 UTC

# Line 1 | Line 1
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;
# Line 21 | Line 21 | import java.lang.reflect.Array;
21   * Here is a complete (although naive) prime filter program:
22   * <pre>
23   * import java.math.BigInteger;
24 < * import jsr166y.forkjoin.*;
25 < * import static jsr166y.forkjoin.Ops.*;
26 < * import static jsr166y.forkjoin.ParallelLongArray.*;
24 > * import jsr166y.*;
25 > * import static extra166y.Ops.*;
26 > * import static extra166y.ParallelLongArray.*;
27   *
28   * public class Sieve {
29   *   public static void main(String[] args) {
# Line 47 | Line 47 | import java.lang.reflect.Array;
47   *   static LongPredicate notDivisibleBy(final long p) {
48   *     return new LongPredicate() {
49   *        public boolean op(long n) { return n &lt;= p || (n % p) != 0; }
50 < *     } }
50 > *     }; }
51   *   static LongPredicate notProbablePrime = new LongPredicate() {
52   *     private static final int CERTAINTY = 8;
53   *     public boolean op(long n) {
54   *       return !BigInteger.valueOf(n).isProbablePrime(CERTAINTY);
55   *     }
56 < *   }
56 > *   };
57   * }
58   * </pre>
59   */
# Line 177 | Line 177 | public class ParallelLongArray extends A
177       * mapped ParallelLongArray.
178       */
179      public static interface SummaryStatistics {
180 <        /** Return the number of elements */
180 >        /** Returns the number of elements */
181          public int size();
182 <        /** Return the minimum element, or Long.MAX_VALUE if empty */
182 >        /** Returns the minimum element, or Long.MAX_VALUE if empty */
183          public long min();
184 <        /** Return the maximum element, or Long.MIN_VALUE if empty */
184 >        /** Returns the maximum element, or Long.MIN_VALUE if empty */
185          public long max();
186 <        /** Return the index of the minimum element, or -1 if empty */
186 >        /** Returns the index of the minimum element, or -1 if empty */
187          public int indexOfMin();
188 <        /** Return the index of the maximum element, or -1 if empty */
188 >        /** Returns the index of the maximum element, or -1 if empty */
189          public int indexOfMax();
190 <        /** Return the sum of all elements */
190 >        /** Returns the sum of all elements */
191          public long sum();
192 <        /** Return the arithmetic average of all elements */
192 >        /** Returns the arithmetic average of all elements */
193          public double average();
194      }
195  
# Line 231 | Line 231 | public class ParallelLongArray extends A
231       * @param op the op
232       * @return this (to simplify use in expressions)
233       */
234 <    public ParallelLongArray replaceWithMapping(LongOp  op) {
234 >    public ParallelLongArray replaceWithMapping(LongOp op) {
235          super.replaceWithMapping(op);
236          return this;
237      }
# Line 965 | Line 965 | public class ParallelLongArray extends A
965      }
966  
967      /**
968 <     * Make len slots available at index
968 >     * Makes len slots available at index.
969       */
970      final void insertSlotsAt(int index, int len) {
971          if (len <= 0)
# Line 1207 | Line 1207 | public class ParallelLongArray extends A
1207      }
1208  
1209   }
1210

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines