public static List fillListImages(List images, ImageSummary iProto, List annotations) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); List imagesList = new ArrayList(); Iterator i = images.iterator(); ImageSummary is; Image img; int id; ImageAnnotation annotation;  while (i.hasNext()) {  img = (Image) i.next(); id = img.getID(); annotation = (ImageAnnotation) ids.get(new Integer(id)); if (annotation != null) { is = (ImageSummary) iProto.makeNew(); buildImageSummary(img, is); is.setAnnotation( AnnotationMapper.fillImageAnnotation(annotation)); imagesList.add(is); } } return imagesList; }
public static List fillListImages(List images, ImageSummary iProto) { List imagesList = new ArrayList(); Iterator i = images.iterator(); ImageSummary is;  while (i.hasNext()) {  is = (ImageSummary) iProto.makeNew(); buildImageSummary((Image) i.next(), is);  imagesList.add(is); } return imagesList; }
    public static List fillListImages(List images, ImageSummary iProto,                                       List annotations)    {        Map ids = AnnotationMapper.reverseListImageAnnotations(annotations);        List imagesList = new ArrayList();  //The returned summary list.        Iterator i = images.iterator();        ImageSummary is;        Image img;        int id;        ImageAnnotation annotation;        //For each d in datasets...        while (i.hasNext()) {            //Make a new DataObject and fill it up.            img = (Image) i.next();            id = img.getID();            annotation = (ImageAnnotation) ids.get(new Integer(id));            if (annotation != null) {                is = (ImageSummary) iProto.makeNew();                buildImageSummary(img, is);                is.setAnnotation(                        AnnotationMapper.fillImageAnnotation(annotation));                imagesList.add(is);            }        }        return imagesList;    }