com.realtime.crossfire.jxclient.faces
Class MemoryImageCache

java.lang.Object
  extended by com.realtime.crossfire.jxclient.faces.MemoryImageCache
All Implemented Interfaces:
ImageCache

public class MemoryImageCache
extends java.lang.Object
implements ImageCache

Simple in-memory cache implementing the ImageCache interface. Primary use is from regression tests.


Field Summary
private  java.util.Map<Face,javax.swing.ImageIcon> faces
          The cache contents.
 
Constructor Summary
MemoryImageCache()
           
 
Method Summary
 javax.swing.ImageIcon load(Face face)
          Retrieves an image from the cache.
 void save(Face face, javax.swing.ImageIcon imageIcon)
          Stores an ImageIcon into the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

faces

@NotNull
private final java.util.Map<Face,javax.swing.ImageIcon> faces
The cache contents. Maps face to image associated with the face.

Constructor Detail

MemoryImageCache

public MemoryImageCache()
Method Detail

load

@Nullable
public javax.swing.ImageIcon load(@NotNull
                                           Face face)
Retrieves an image from the cache.

Specified by:
load in interface ImageCache
Parameters:
face - the face to retrieve
Returns:
the image icon, or null if the cache does not contain the image

save

public void save(@NotNull
                 Face face,
                 @NotNull
                 javax.swing.ImageIcon imageIcon)
Stores an ImageIcon into the cache.

Specified by:
save in interface ImageCache
Parameters:
face - the face to save
imageIcon - the image icon to store