@Test public void testOneElementAggregationAllValid() throws Exception { int maskAttributeIndex = 6; Record aggregatedRecord = new RecordAggregator(maskAttributeIndex, 1.5).transform( createDataRecord(new float[]{1.1F}, new int[]{64}, new int[]{1})); assertNotNull(aggregatedRecord); testFirst4Values(aggregatedRecord); Object v5 = aggregatedRecord.getAttributeValues()[4]; assertEquals(Float.class, v5.getClass()); Float a5 = (Float) v5; assertEquals(1.1F, a5, 1E-5F); Object v6 = aggregatedRecord.getAttributeValues()[5]; assertEquals(Integer.class, v6.getClass()); assertEquals(64, v6); Object v7 = aggregatedRecord.getAttributeValues()[6]; assertEquals(Integer.class, v7.getClass()); assertEquals(1, 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);  }