org.molwind.io
Class ImageFileCache

java.lang.Object
  extended by org.molwind.io.ImageFileCache

public class ImageFileCache
extends java.lang.Object

Stores generated images in the cache.

Version:
0.1

Constructor Summary
ImageFileCache()
          Empty constructer to build a Cache with the maximum size of 100
ImageFileCache(int size)
          Constructor to build a Cache with the given size
 
Method Summary
 java.awt.image.BufferedImage getImage(java.io.File imageFile)
          Returns the given image from the image file cache.
 java.awt.image.BufferedImage getImage(java.lang.String fileName)
           
 org.apache.commons.collections.map.LRUMap getImageCache()
          Get the imageCache.
static ImageFileCache getInstance()
          Returns the instance of the image file cache.
 void putImage(java.io.File imageFile)
          Puts a Buffered image to the Chache with the filename as key
 void set(org.apache.commons.collections.map.LRUMap newCache)
          Set the imageCache.
 void update(java.io.File imageFile, ImageFileCache imageFileCache)
          Updates the given Image in the image cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFileCache

public ImageFileCache()
Empty constructer to build a Cache with the maximum size of 100


ImageFileCache

public ImageFileCache(int size)
Constructor to build a Cache with the given size

Method Detail

getImageCache

public org.apache.commons.collections.map.LRUMap getImageCache()
Get the imageCache.

Returns:
the imageCache.

set

public void set(org.apache.commons.collections.map.LRUMap newCache)
Set the imageCache.

Parameters:
new - The new value.

getInstance

public static ImageFileCache getInstance()
Returns the instance of the image file cache.

Returns:
the image file cache instance

update

public void update(java.io.File imageFile,
                   ImageFileCache imageFileCache)
            throws java.io.IOException
Updates the given Image in the image cache.

Parameters:
imageFile - the image file
imageCache - the image file cache
Throws:
java.io.IOException

getImage

public java.awt.image.BufferedImage getImage(java.lang.String fileName)

putImage

public void putImage(java.io.File imageFile)
              throws java.io.IOException
Puts a Buffered image to the Chache with the filename as key

Parameters:
imageFile -
Throws:
java.io.IOException

getImage

public java.awt.image.BufferedImage getImage(java.io.File imageFile)
Returns the given image from the image file cache.

Parameters:
imageFile - the image file
Returns:
the cached image


Copyright © 2008-2010. All Rights Reserved.