Class FileCache
- java.lang.Object
-
- com.realtime.crossfire.jxclient.faces.FileCache
-
- All Implemented Interfaces:
ImageCache
public class FileCache extends java.lang.Object implements ImageCache
A disk based cache for image files.
-
-
Constructor Summary
Constructors Constructor Description FileCache(@NotNull java.nio.file.Path cacheDir)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable javax.swing.ImageIconload(@NotNull Face face)Retrieves an image from the cache.voidsave(@NotNull Face face, @NotNull javax.swing.ImageIcon imageIcon)Stores anImageIconinto the cache.voidsave(@NotNull java.lang.String faceName, int faceChecksum, @NotNull javax.swing.Icon imageIcon)Stores anImageIconinto the cache.
-
-
-
Method Detail
-
load
@Nullable public @Nullable javax.swing.ImageIcon load(@NotNull @NotNull Face face)Description copied from interface:ImageCacheRetrieves an image from the cache.- Specified by:
loadin interfaceImageCache- Parameters:
face- the face to retrieve- Returns:
- the image icon, or
nullif the cache does not contain the image
-
save
public void save(@NotNull @NotNull Face face, @NotNull @NotNull javax.swing.ImageIcon imageIcon)Description copied from interface:ImageCacheStores anImageIconinto the cache.- Specified by:
savein interfaceImageCache- Parameters:
face- the face to saveimageIcon- the image icon to store
-
save
public void save(@NotNull @NotNull java.lang.String faceName, int faceChecksum, @NotNull @NotNull javax.swing.Icon imageIcon)Stores anImageIconinto the cache.- Parameters:
faceName- the image name to savefaceChecksum- the checksum to saveimageIcon- the image icon to store
-
-