@Test public void testThatInputSortingWorks() throws Exception { DefaultRecordSource input = new DefaultRecordSource(new TestHeader(true, "lat", "lon"), new TestRecord(0, new GeoPos(0.0F, 0.0F)), new TestRecord(1, new GeoPos(0.0F, 1.0F - EPS)), new TestRecord(2, new GeoPos(1.0F, 0.0F)), new TestRecord(3, new GeoPos(0.5F, 0.5F)), new TestRecord(4, new GeoPos(1.0F, 1.0F - EPS))); final int PIXEL_Y = 3; MAConfig config1 = new MAConfig(); config1.setMacroPixelSize(1); config1.setCopyInput(false); ProductRecordSource sort = createProductRecordSource(2, 3, input, config1); List<Record> sorted = getRecords(sort); assertEquals(5, sorted.size()); assertEquals(0, ((int[]) sorted.get(0).getAttributeValues()[PIXEL_Y])[0]); assertEquals(0, ((int[]) sorted.get(1).getAttributeValues()[PIXEL_Y])[0]); assertEquals(1, ((int[]) sorted.get(2).getAttributeValues()[PIXEL_Y])[0]); assertEquals(2, ((int[]) sorted.get(3).getAttributeValues()[PIXEL_Y])[0]); assertEquals(2, ((int[]) sorted.get(4).getAttributeValues()[PIXEL_Y])[0]); }
@Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); @Override Header getHeader(); @Override Iterable<Record> getRecords(); @Override String getTimeAndLocationColumnDescription(); }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); @Override Header getHeader(); @Override Iterable<Record> getRecords(); @Override String getTimeAndLocationColumnDescription(); static final String SOURCE_NAME_ATT_NAME; static final String PIXEL_X_ATT_NAME; static final String PIXEL_Y_ATT_NAME; static final String PIXEL_LAT_ATT_NAME; static final String PIXEL_LON_ATT_NAME; static final String PIXEL_TIME_ATT_NAME; static final String PIXEL_MASK_ATT_NAME; }