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

Comparing jsr166/src/test/extra166y/CombineDemo.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:42 2009 UTC

# Line 45 | Line 45 | class CombineDemo {
45      }
46  
47      static class Evens implements Ops.IntToObject<Long> {
48 <        public Long op(int i) {
48 >        public Long op(int i) {
49              return Long.valueOf((long)(i << 1));
50          }
51      }
# Line 250 | Line 250 | class CombineDemo {
250  
251      // ............
252  
253 <    static void seqRemoveAll(ParallelArray<Long> pa,
253 >    static void seqRemoveAll(ParallelArray<Long> pa,
254                               Ops.Predicate<Long> selector) {
255          Long[] a = pa.getArray();
256          int n = pa.size();
# Line 265 | Line 265 | class CombineDemo {
265          pa.setLimit(k);
266      }
267  
268 <    static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa,
268 >    static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa,
269                                          Ops.Predicate<Long> selector) {
270          ArrayList<Long> al = new ArrayList<Long>();
271          Long[] a = pa.getArray();
# Line 281 | Line 281 | class CombineDemo {
281      static Long[] seqUnique(Long[] a) {
282          int n = a.length;
283          HashSet<Long> m = new HashSet<Long>(n);
284 <        for (int i = 0; i < n; ++i)
284 >        for (int i = 0; i < n; ++i)
285              m.add(a[i]);
286          int ul = m.size();
287          Long[] u = new Long[ul];
# Line 290 | Line 290 | class CombineDemo {
290              u[k++] = e;
291          return u;
292      }
293 <    
293 >
294      static void checkSorted (ParallelArray<Long> pa)  {
295          int n = pa.size();
296          for (int i = 0; i < n - 1; i++) {
# Line 299 | Line 299 | class CombineDemo {
299              }
300          }
301      }
302 <    
302 >
303      static final class RandomLongGenerator implements Ops.Generator<Long> {
304          public Long op() {
305              return new Long(ThreadLocalRandom.current().nextLong(maxValue));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines