static Iterable < ImmutableBitmap > bitmapsFromIndexes ( final IntIterable indexes , final BitmapIndex bitmapIndex ) { // Do not use Iterables.transform() to avoid boxing/unboxing integers. return new Iterable < ImmutableBitmap > ( ) { @ Override public Iterator < ImmutableBitmap > iterator ( ) { final IntIterator iterator = indexes . iterator ( ) ; return new Iterator < ImmutableBitmap > ( ) { @ Override public boolean hasNext ( ) { return iterator . hasNext ( ) ; } @ Override public ImmutableBitmap next ( ) { return bitmapIndex . getBitmap ( iterator . nextInt ( ) ) ; } @ Override public void remove ( ) { throw new UnsupportedOperationException ( ) ; } } ; } } ; }
Transform an iterable of indexes of bitmaps to an iterable of bitmaps