net.ctdp.rfdynhud.util
Interface ImageCache

All Known Implementing Classes:
DefaultImageCache

public interface ImageCache

An image cache caches images by their names.

Author:
Marvin Froehlich (CTDP)

Method Summary
 ImageTemplate add(java.lang.String name, long lastModified, ImageTemplate image)
          Adds an image to the cache.
 void check(java.lang.String name, long lastModified)
          Checks, whether an image is cached by the given name and matches the given 'lastModified' date.
 boolean contains(java.lang.String name)
          Checks, whether an image exists in the cache by the given name.
 ImageTemplate get(java.lang.String name)
          Gets the cached image by the given name.
 ImageTemplate remove(java.lang.String name)
          Removes an image from the cache.
 

Method Detail

add

ImageTemplate add(java.lang.String name,
                  long lastModified,
                  ImageTemplate image)
Adds an image to the cache.

Parameters:
name - the name to cache by
lastModified - the last modified timestamp
image - the image to cache
Returns:
the previously cached image.

remove

ImageTemplate remove(java.lang.String name)
Removes an image from the cache.

Parameters:
name - the name it is cached by
Returns:
the cached image, if present.

contains

boolean contains(java.lang.String name)
Checks, whether an image exists in the cache by the given name.

Parameters:
name - the name to search for
Returns:
true, if the image is present, false otherwise.

check

void check(java.lang.String name,
           long lastModified)
Checks, whether an image is cached by the given name and matches the given 'lastModified' date.

Parameters:
name - the name to search for
lastModified - the last modified timestamp

get

ImageTemplate get(java.lang.String name)
Gets the cached image by the given name.

Parameters:
name - the name to search for
Returns:
the cached image or null, if not present.