@Test public void testOneElementAggregationAllInvalid() throws Exception { int maskAttributeIndex = 6; float[] value5 = {1.1F}; int[] value6 = {64}; int[] mask = {0}; Record aggregatedRecord = new RecordAggregator(maskAttributeIndex, 1.5).transform( createDataRecord(value5, value6, mask)); assertNotNull(aggregatedRecord); testFirst4Values(aggregatedRecord); Object v5 = aggregatedRecord.getAttributeValues()[4]; assertEquals(Float.class, v5.getClass()); Float a5 = (Float) v5; assertTrue(Float.isNaN(a5)); Object v6 = aggregatedRecord.getAttributeValues()[5]; assertEquals(null, v6); Object v7 = aggregatedRecord.getAttributeValues()[6]; assertEquals(Integer.class, v7.getClass()); assertEquals(0, v7); }
@Override public Iterable<Record> transform(Iterable<Record> recordIterable) { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new RecIt(recordIterable.iterator()); } }; }
RecordAggregator implements RecordTransformer { @Override public Iterable<Record> transform(Iterable<Record> recordIterable) { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new RecIt(recordIterable.iterator()); } }; } }
RecordAggregator implements RecordTransformer { @Override public Iterable<Record> transform(Iterable<Record> recordIterable) { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new RecIt(recordIterable.iterator()); } }; } RecordAggregator(int maskAttributeIndex, double filteredMeanCoeff); }
RecordAggregator implements RecordTransformer { @Override public Iterable<Record> transform(Iterable<Record> recordIterable) { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new RecIt(recordIterable.iterator()); } }; } RecordAggregator(int maskAttributeIndex, double filteredMeanCoeff); static RecordTransformer create(Header header, double filteredMeanCoeff); @Override Iterable<Record> transform(Iterable<Record> recordIterable); Record transform(Record record); }
RecordAggregator implements RecordTransformer { @Override public Iterable<Record> transform(Iterable<Record> recordIterable) { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new RecIt(recordIterable.iterator()); } }; } RecordAggregator(int maskAttributeIndex, double filteredMeanCoeff); static RecordTransformer create(Header header, double filteredMeanCoeff); @Override Iterable<Record> transform(Iterable<Record> recordIterable); Record transform(Record record);  }