コード例 #1
1
 static List populatedArray(int n) {
   List a = ParallelArray.createEmpty(n, Object.class, ParallelArray.defaultExecutor()).asList();
   assertTrue(a.isEmpty());
   for (int i = 0; i < n; ++i) a.add(new Integer(i));
   assertFalse(a.isEmpty());
   assertEquals(n, a.size());
   return a;
 }
コード例 #2
0
 /** new list contains all elements of initializing array */
 public void testConstructor2() {
   Integer[] ints = new Integer[SIZE];
   for (int i = 0; i < SIZE - 1; ++i) ints[i] = new Integer(i);
   List a = ParallelArray.createUsingHandoff(ints, ParallelArray.defaultExecutor()).asList();
   for (int i = 0; i < SIZE; ++i) assertEquals(ints[i], a.get(i));
 }
コード例 #3
0
 /** a new list is empty */
 public void testConstructor() {
   List a = ParallelArray.createEmpty(1, Object.class, ParallelArray.defaultExecutor()).asList();
   assertTrue(a.isEmpty());
 }
コード例 #4
0
 static List emptyArray() {
   List a = ParallelArray.createEmpty(1, Object.class, ParallelArray.defaultExecutor()).asList();
   return a;
 }