| Modifier and Type | Class and Description |
|---|---|
| private static class | ImageCache.
Extended SoftReference that stores the pixel count even after the image is lost |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final ImageCache | |
| private ReadWriteLock | |
| private final LinkedHashMap | |
| private final int | |
| private final int | |
| private ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Image | Returns: Returns the cached Image, or null there is no cached image for keyThe graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key config, int The image width, used as part of cache key w, int The image height, used as part of cache key h, Object... Other arguments to use as part of the cache key args)Get the cached image for given keys |
| pack-priv static ImageCache | |
| private int | hash(GraphicsConfiguration config, int w, int h, Object... args)
Create a unique hash from all the input |
| public boolean | Returns: True if the image size is less than maxThe image width w, int The image height h)Check if the image size is to big to be stored in the cache |
| public boolean | Returns: true if the image could be cached or false if the image is too bigThe image to store in cache image, GraphicsConfiguration The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key config, int The image width, used as part of cache key w, int The image height, used as part of cache key h, Object... Other arguments to use as part of the cache key args)Sets the cached image for the specified constraints. |
| currentPixelCount | back to summary |
|---|---|
| private int currentPixelCount | |
| instance | back to summary |
|---|---|
| private static final ImageCache instance | |
| lock | back to summary |
|---|---|
| private ReadWriteLock lock | |
| map | back to summary |
|---|---|
| private final LinkedHashMap<Integer, ImageCache. | |
| maxPixelCount | back to summary |
|---|---|
| private final int maxPixelCount | |
| maxSingleImagePixelSize | back to summary |
|---|---|
| private final int maxSingleImagePixelSize | |
| referenceQueue | back to summary |
|---|---|
| private ReferenceQueue<Image> referenceQueue | |
| ImageCache | back to summary |
|---|---|
| public ImageCache() | |
| ImageCache | back to summary |
|---|---|
| public ImageCache(int maxPixelCount, int maxSingleImagePixelSize) | |
| flush | back to summary |
|---|---|
| public void flush() Clear the cache | |
| getImage | back to summary |
|---|---|
| public Image getImage(GraphicsConfiguration config, int w, int h, Object... args) Get the cached image for given keys
| |
| getInstance | back to summary |
|---|---|
| pack-priv static ImageCache getInstance() Get static singleton instance | |
| hash | back to summary |
|---|---|
| private int hash(GraphicsConfiguration config, int w, int h, Object... args) Create a unique hash from all the input | |
| isImageCachable | back to summary |
|---|---|
| public boolean isImageCachable(int w, int h) Check if the image size is to big to be stored in the cache
| |
| setImage | back to summary |
|---|---|
| public boolean setImage(Image image, GraphicsConfiguration config, int w, int h, Object... args) Sets the cached image for the specified constraints.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Object[] | |
| private final GraphicsConfiguration | |
| private final int | |
| private final int | |
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | PixelCountSoftReference(Image referent, ReferenceQueue<? super Image> q, int pixelCount, int hash, GraphicsConfiguration config, int w, int h, Object[] args)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| args | back to summary |
|---|---|
| private final Object[] args | |
| config | back to summary |
|---|---|
| private final GraphicsConfiguration config | |
| h | back to summary |
|---|---|
| private final int h | |
| hash | back to summary |
|---|---|
| private final int hash | |
| pixelCount | back to summary |
|---|---|
| private final int pixelCount | |
| w | back to summary |
|---|---|
| private final int w | |
| PixelCountSoftReference | back to summary |
|---|---|
| public PixelCountSoftReference(Image referent, ReferenceQueue<? super Image> q, int pixelCount, int hash, GraphicsConfiguration config, int w, int h, Object[] args) | |
| equals | back to summary |
|---|---|
| public boolean equals(GraphicsConfiguration config, int w, int h, Object[] args) | |