net.sourceforge.pavlov.randommedia
Class CacheObject

java.lang.Object
  extended by net.sourceforge.pavlov.randommedia.CacheObject

public class CacheObject
extends Object

A (media) object that can be cached.


Field Summary
 Object object
          The object itself.
 URL url
          The URL of this object.
 
Constructor Summary
CacheObject(URL myUrl, Object myObj)
          Creates a new CacheObject instance.
 
Method Summary
protected  void finalize()
          Describe finalize method here.
 String getDirectoryName()
          What's before the last slash in the filename.
 String getFileName()
          Returns the object's filename.
 String getFileShortName()
          The substring after the last slash in the filename.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

public volatile URL url
The URL of this object.


object

public volatile Object object
The object itself.

Constructor Detail

CacheObject

public CacheObject(URL myUrl,
                   Object myObj)
Creates a new CacheObject instance.

Parameters:
myUrl - an URL value
myObj - an Object value
Method Detail

getFileName

public String getFileName()
Returns the object's filename.

Returns:
a String value

getFileShortName

public String getFileShortName()
The substring after the last slash in the filename. I.e., file://foo/bar/whee/whopper.jpg -> whopper.jpg.

Returns:
a String value

getDirectoryName

public String getDirectoryName()
What's before the last slash in the filename. I.e., file://foo/bar/whee/whopper.jpg -> file://foo/bar/whee.

Returns:
a String value

finalize

protected void finalize()
                 throws Throwable
Describe finalize method here.

Overrides:
finalize in class Object
Throws:
Throwable - if an error occurs