/** * Gets a new iterator based on the bounds of the first image added * to this set or, if that has been removed, the image that has been * in this set for the longest period. * * @return the new iterator * * @throws IllegalArgumentException if this image set is empty */ public Iterator<K> getIterator() { return getIterator(elements.keySet().iterator().next()); }
/** * Gets a new iterator based on the bounds of the image with the * specified key value. * * @param referenceImageKey the key of the image to use as the reference * for the iterator * * @return the new iterator * * @throws IllegalArgumentException if this image set is empty or if no * image corresponds to the key value */ public Iterator<K> getIterator(K referenceImageKey) { if (elements.isEmpty()) { throw new IllegalArgumentException("This image set is empty"); } Rectangle bounds = getBounds(referenceImageKey); return getIterator(bounds); }