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

Comparing jsr166/src/test/extra166y/SetOpsDemo.java (file contents):
Revision 1.1 by dl, Sun Nov 1 22:00:35 2009 UTC vs.
Revision 1.2 by jsr166, Mon Nov 16 04:16:43 2009 UTC

# Line 47 | Line 47 | class SetOpsDemo {
47      }
48  
49      static class Evens implements Ops.IntToObject<Long> {
50 <        public Long op(int i) {
50 >        public Long op(int i) {
51              return Long.valueOf((long)(i << 1));
52          }
53      }
# Line 252 | Line 252 | class SetOpsDemo {
252  
253      // ............
254  
255 <    static void seqRemoveAll(ParallelArray<Long> pa,
255 >    static void seqRemoveAll(ParallelArray<Long> pa,
256                               Ops.Predicate<Long> selector) {
257          Long[] a = pa.getArray();
258          int n = pa.size();
# Line 267 | Line 267 | class SetOpsDemo {
267          pa.setLimit(k);
268      }
269  
270 <    static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa,
270 >    static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa,
271                                          Ops.Predicate<Long> selector) {
272          ArrayList<Long> al = new ArrayList<Long>();
273          Long[] a = pa.getArray();
# Line 283 | Line 283 | class SetOpsDemo {
283      static Long[] seqUnique(Long[] a) {
284          int n = a.length;
285          HashSet<Long> m = new HashSet<Long>(n);
286 <        for (int i = 0; i < n; ++i)
286 >        for (int i = 0; i < n; ++i)
287              m.add(a[i]);
288          int ul = m.size();
289          Long[] u = new Long[ul];
# Line 292 | Line 292 | class SetOpsDemo {
292              u[k++] = e;
293          return u;
294      }
295 <    
295 >
296      static void checkSorted (ParallelArray<Long> pa)  {
297          int n = pa.size();
298          for (int i = 0; i < n - 1; i++) {
# Line 301 | Line 301 | class SetOpsDemo {
301              }
302          }
303      }
304 <    
304 >
305      static final class RandomLongGenerator implements Ops.Generator<Long> {
306          public Long op() {
307              return new Long(ThreadLocalRandom.current().nextLong(maxValue));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines