@Test public void testBatch() { final int batchSize = 1 + this.r.nextInt(20); final int numberOfAttributes = 1 + this.r.nextInt(5); final int[] type = new int[numberOfAttributes]; for(int j = 0; j < numberOfAttributes; ++j) { type[j] = this.r.nextInt(3); } Batch b = new Batch(batchSize, numberOfAttributes); Assert.assertTrue(b.isEmpty()); for(int i = 0; i < batchSize; ++i) { Values tuple = new Values(); for(int j = 0; j < numberOfAttributes; ++j) { switch(type[j]) { case 0: tuple.add(j, new Integer(this.r.nextInt())); break; case 1: tuple.add(j, new Double(this.r.nextDouble() + this.r.nextLong())); break; default: tuple.add(j, new String("" + (char)(32 + this.r.nextInt(95)))); } } b.addTuple(tuple); if(i < batchSize - 1) { Assert.assertFalse(b.isFull()); } else { Assert.assertTrue(b.isFull()); } Assert.assertFalse(b.isEmpty()); } }
public Batch() { super(); }
Batch extends ArrayList<BatchColumn> { public Batch() { super(); } }
Batch extends ArrayList<BatchColumn> { public Batch() { super(); } Batch();  Batch(int batchSize, int numberOfAttributes); }
Batch extends ArrayList<BatchColumn> { public Batch() { super(); } Batch();  Batch(int batchSize, int numberOfAttributes); void addTuple(List<Object> tuple); boolean isFull(); @Override boolean isEmpty(); }
Batch extends ArrayList<BatchColumn> { public Batch() { super(); } Batch();  Batch(int batchSize, int numberOfAttributes); void addTuple(List<Object> tuple); boolean isFull(); @Override boolean isEmpty();  }