--- jsr166/src/test/extra166y/LongSetOpsDemo.java 2009/11/01 22:00:35 1.1 +++ jsr166/src/test/extra166y/LongSetOpsDemo.java 2011/03/15 19:47:04 1.5 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ import jsr166y.*; @@ -16,7 +16,7 @@ class LongSetOpsDemo { static int reps = 16; static final long maxValue = 1 << 12; - public static void main (String[] args) throws Exception { + public static void main(String[] args) throws Exception { int n = 1 << 20; long[] a = new long[n]; ParallelLongArray pa = ParallelLongArray.createUsingHandoff(a, fjpool); @@ -44,7 +44,7 @@ class LongSetOpsDemo { } static class Evens implements Ops.IntToLong { - public long op(int i) { + public long op(int i) { return ((long)(i << 1)); } } @@ -249,7 +249,7 @@ class LongSetOpsDemo { System.out.printf("Seq index time : %7.3f\n", de); } - static void seqRemoveAll(ParallelLongArray pa, + static void seqRemoveAll(ParallelLongArray pa, Ops.LongPredicate selector) { long[] a = pa.getArray(); int n = pa.size(); @@ -262,7 +262,7 @@ class LongSetOpsDemo { pa.setLimit(k); } - static ArrayList seqSelectAll(ParallelLongArray pa, + static ArrayList seqSelectAll(ParallelLongArray pa, Ops.LongPredicate selector) { ArrayList al = new ArrayList(); long[] a = pa.getArray(); @@ -278,7 +278,7 @@ class LongSetOpsDemo { static long[] seqUnique(long[] a) { int n = a.length; HashSet m = new HashSet(n); - for (int i = 0; i < n; ++i) + for (int i = 0; i < n; ++i) m.add(Long.valueOf(a[i])); int ul = m.size(); long[] u = new long[ul]; @@ -287,8 +287,8 @@ class LongSetOpsDemo { u[k++] = e; return u; } - - static void checkSorted (ParallelLongArray pa) { + + static void checkSorted(ParallelLongArray pa) { int n = pa.size(); for (int i = 0; i < n - 1; i++) { if (pa.get(i) >= pa.get(i+1)) { @@ -296,6 +296,6 @@ class LongSetOpsDemo { } } } - + }