net.sourceforge.pavlov.randommedia
Class ImageCache

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<E>
              extended by java.util.Stack<Object>
                  extended by net.sourceforge.pavlov.randommedia.MediaCache
                      extended by net.sourceforge.pavlov.randommedia.ImageCache
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess

public class ImageCache
extends MediaCache

Loads and holds a bunch of image files whose locations are specified relative to a fixed base URL.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ImageCache(RandomURLProvider p, int size)
          Creates a new ImageCache instance.
 
Method Summary
 ContentLoader getContentLoader()
          Describe getContentLoader method here.
 CacheObject getRandomCacheObject()
          Describe getRandomCacheObject method here.
 ImageIcon getRandomImageIcon(int size)
          Gets a random image icon of the given size from the cache.
 CacheObject getRandomUncachedObject()
          Describe getRandomUncachedObject method here.
 ImageIcon getUncachedRandomImageIcon(int size)
          Describe getUncachedRandomImageIcon method here.
 CacheObject loadCacheObject()
          Describe loadCacheObject method here.
protected static Object nullNotifier(String msg)
          If there's a null in an intermediate step, let the user know.
 
Methods inherited from class net.sourceforge.pavlov.randommedia.MediaCache
add, clearCache, getObject, manageCache, startLoading
 
Methods inherited from class java.util.Stack
empty, peek, pop, push, search
 
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

ImageCache

public ImageCache(RandomURLProvider p,
                  int size)
Creates a new ImageCache instance.

Parameters:
p - a RandomURLProvider value
size - an int value
Method Detail

loadCacheObject

public CacheObject loadCacheObject()
Describe loadCacheObject method here.

Returns:
a CacheObject value

getUncachedRandomImageIcon

public ImageIcon getUncachedRandomImageIcon(int size)
Describe getUncachedRandomImageIcon method here.

Parameters:
size - an int value
Returns:
an ImageIcon value

getRandomUncachedObject

public CacheObject getRandomUncachedObject()
Describe getRandomUncachedObject method here.

Returns:
a CacheObject value

getRandomCacheObject

public CacheObject getRandomCacheObject()
Describe getRandomCacheObject method here.

Returns:
a CacheObject value

getRandomImageIcon

public ImageIcon getRandomImageIcon(int size)
Gets a random image icon of the given size from the cache. Initializes or loads cache objects as necessary.

Parameters:
size - an int value
Returns:
an ImageIcon value

nullNotifier

protected static Object nullNotifier(String msg)
If there's a null in an intermediate step, let the user know. This is useful for debugging.

Parameters:
msg - a String value
Returns:
an Object value

getContentLoader

public ContentLoader getContentLoader()
Describe getContentLoader method here.

Returns:
a ContentLoader value