ColorImage aggregation = new AggregatedColorImage((ScalableColorImage[])examples.toArray(), aggregator); ArraysBackedList l = new ArraysBackedList(getPageSize()); for (int i = 0; i < getPageCount(); i++) l.addArray(pages[i]); measure.setImage(aggregation); Iterator it = l.iterator(); while (it.hasNext()) { ImageData id = (ImageData) it.next(); id.setSimilarity(measure.similarity(id.getColorImage())); } Collections.sort(l);
for (int i = 1; i <= getPageCount(); i++) reorderPage(i); mergeReorderedPages();
	public void reorderImages() {		ColorImage aggregation = 			new AggregatedColorImage((ScalableColorImage[])examples.toArray(), aggregator);		ArraysBackedList l = new ArraysBackedList(getPageSize());		for (int i = 0; i < getPageCount(); i++)			l.addArray(pages[i]);		measure.setImage(aggregation);		Iterator it = l.iterator();		while (it.hasNext()) {			ImageData id = (ImageData) it.next();			id.setSimilarity(measure.similarity(id.getColorImage()));		}		Collections.sort(l);	}