APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.swing

public Class ImageCache

extends Object
Class Inheritance
Imports
java.awt.GraphicsConfiguration, .Image, java.lang.ref.SoftReference, java.util.Iterator, .LinkedList

Cache is used to cache an image based on a set of arguments.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ImageCache.Entry

Caches set of arguments and Image.

Field Summary

Modifier and TypeField and Description
private final LinkedList<SoftReference<ImageCache.Entry>>
private int

Constructor Summary

AccessConstructor and Description
public
ImageCache(int maxCount)

Method Summary

Modifier and TypeMethod and Description
public void
private ImageCache.Entry
getEntry(Object key, GraphicsConfiguration config, int w, int h, Object[] args)

public Image
getImage(Object key, GraphicsConfiguration config, int w, int h, Object[] args)

Returns the cached Image, or null, for the specified arguments.

public void
setImage(Object key, GraphicsConfiguration config, int w, int h, Object[] args, Image image)

Sets the cached image for the specified constraints.

pack-priv void
setMaxCount(int maxCount)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entriesback to summary
private final LinkedList<SoftReference<ImageCache.Entry>> entries
maxCountback to summary
private int maxCount

Constructor Detail

ImageCacheback to summary
public ImageCache(int maxCount)

Method Detail

flushback to summary
public void flush()
getEntryback to summary
private ImageCache.Entry getEntry(Object key, GraphicsConfiguration config, int w, int h, Object[] args)
getImageback to summary
public Image getImage(Object key, GraphicsConfiguration config, int w, int h, Object[] args)

Returns the cached Image, or null, for the specified arguments.

setImageback to summary
public void setImage(Object key, GraphicsConfiguration config, int w, int h, Object[] args, Image image)

Sets the cached image for the specified constraints.

setMaxCountback to summary
pack-priv void setMaxCount(int maxCount)
sun.swing back to summary

private Class ImageCache.Entry

extends Object
Class Inheritance

Caches set of arguments and Image.

Field Summary

Modifier and TypeField and Description
private final Object[]
private final GraphicsConfiguration
private final int
h

private Image
private final int
w

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(GraphicsConfiguration config, int w, int h, Object[] args)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(GraphicsConfiguration config, int w, int h, Object[] args)

public Image
public void
setImage(Image image)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

argsback to summary
private final Object[] args
configback to summary
private final GraphicsConfiguration config
hback to summary
private final int h
imageback to summary
private Image image
wback to summary
private final int w

Constructor Detail

Entryback to summary
pack-priv Entry(GraphicsConfiguration config, int w, int h, Object[] args)

Method Detail

equalsback to summary
public boolean equals(GraphicsConfiguration config, int w, int h, Object[] args)
getImageback to summary
public Image getImage()
setImageback to summary
public void setImage(Image image)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.