|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaitools.imageutils.ImageSet<K>
K - public class ImageSet<K>
| Nested Class Summary | |
|---|---|
static class |
ImageSet.Element
An ImageSet element consisting of a RenderedImage
and an associated outside value. |
static class |
ImageSet.Iterator<K>
|
| Constructor Summary | |
|---|---|
ImageSet()
Creates a new, empty image set. |
|
| Method Summary | ||
|---|---|---|
void |
add(K key,
RenderedImage image,
Number outsideValue)
Adds an image to this set to be associated with the given key. |
|
void |
clear()
Removes all key:image pairs from this image set. |
|
boolean |
containsImage(RenderedImage image)
Tests if this image set contains the given image. |
|
boolean |
containsKey(K key)
Tests if this image set contains the given key. |
|
static
|
copy(ImageSet<K> set)
Creates a new image set which will contain the same keys, images and outside values as the input set. |
|
RenderedImage |
get(K key)
Retrieves an image from this set. |
|
Rectangle |
getBounds(K key)
Gets the bounds of the image associated with the given key. |
|
Rectangle |
getIntersectionBounds()
Gets the common bounds of images in this set This is the intersection of the individual iamge bounds. |
|
ImageSet.Iterator<K> |
getIterator()
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. |
|
ImageSet.Iterator<K> |
getIterator(K referenceImageKey)
Gets a new iterator based on the bounds of the image with the specified key value. |
|
ImageSet.Iterator<K> |
getIterator(Rectangle bounds)
Gets a new iterator based on the bounds of the image with the specified key value. |
|
Number |
getOutsideValue(K key)
Gets the value that an image set iterator will return for the image associated with the given key when it is positioned outside the bounds of that image. |
|
Rectangle |
getUnionBounds()
Gets the enclosing bounds of all images in this set. |
|
boolean |
isEmpty()
Tests if this image set is empty. |
|
Set<K> |
keySet()
Retrieves a Set view of the keys in this image set. |
|
void |
putAll(ImageSet<? extends K> otherSet)
Copies all key:image pairs from otherSet into this image set. |
|
RenderedImage |
remove(K key)
Removes a key:image pair from this set. |
|
int |
size()
Gets the number of key:image pairs in this set. |
|
Set<RenderedImage> |
values()
Retrieves a Set view of the keys in this image set. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageSet()
| Method Detail |
|---|
public static <K> ImageSet<K> copy(ImageSet<K> set)
null or
empty, an empty image set is created.
K - the key typeset - the image set to copy
public void add(K key,
RenderedImage image,
Number outsideValue)
key - the keyimage - the imageoutsideValue - the value to be returned by iterators when
positions beyond the bounds of this image (may be null
IllegalArgumentException - if either key or image
is nullpublic int size()
public boolean isEmpty()
true if the set is emptypublic boolean containsKey(K key)
key - the key to search for
true if the key is found; false otherwise
IllegalArgumentException - if key is nullpublic boolean containsImage(RenderedImage image)
image - the image to search for
true is the image is in this set; false otherwisepublic RenderedImage get(K key)
key - the key associated with the image.
null if the key could not be foundpublic RenderedImage remove(K key)
key - the key
null if
the key could not be foundpublic void putAll(ImageSet<? extends K> otherSet)
otherSet into this image set.
otherSet - the image set to take contents from
IllegalArgumentException - if otherSet is nullpublic void clear()
public Set<K> keySet()
Set view of the keys in this image set.
Note that unlike Java collection classes, this method returns an
unmodifiable view of the keys.
public Set<RenderedImage> values()
Set view of the keys in this image set.
Note that unlike Java collection classes, this method returns an
unmodifiable view of the keys.
public ImageSet.Iterator<K> getIterator()
IllegalArgumentException - if this image set is emptypublic ImageSet.Iterator<K> getIterator(K referenceImageKey)
referenceImageKey - the key of the image to use as the reference
for the iterator
IllegalArgumentException - if this image set is empty or if no
image corresponds to the key valuepublic ImageSet.Iterator<K> getIterator(Rectangle bounds)
bounds - iterator bounds
IllegalArgumentException - if this image set is empty or if no
image corresponds to the key valuepublic Rectangle getBounds(K key)
key - the image key
null if the key
could not be foundpublic Rectangle getUnionBounds()
Rectangle will be returned.
public Rectangle getIntersectionBounds()
Rectangle will be
returned if ths set is empty, or if there is no area over which all
images overlap.
public Number getOutsideValue(K key)
key - the key
null)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||