Jadex 0.96-beta1

jadex.util
Class CachedObject

java.lang.Object
  extended by jadex.util.CachedObject
All Implemented Interfaces:
Serializable

public class CachedObject
extends Object
implements Serializable

A cache for an object that was loaded from a file or url. The cache can be made persistent on disk (uses the filename). For a new cache the object to be cached can be set.

See Also:
Serialized Form

Constructor Summary
CachedObject(String filename, long lastmodified, Serializable cachedobject)
          Create a new file cache.
 
Method Summary
 String getFilename()
          Get the filename.
 long getLastModified()
          Get the last modified date.
 Serializable getObject()
          Get the cached object
 void persist()
          Persist the cached object.
 void setFilename(String filename)
          Set the filename.
 void setLastModified(long lastmodified)
          Set the last modified date.
 void setObject(Serializable cachedobject)
          Set the cached object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedObject

public CachedObject(String filename,
                    long lastmodified,
                    Serializable cachedobject)
Create a new file cache.

Method Detail

setObject

public void setObject(Serializable cachedobject)
Set the cached object.

Parameters:
cachedobject - The cached object.

getObject

public Serializable getObject()
Get the cached object

Returns:
The cached object.

getLastModified

public long getLastModified()
Get the last modified date.

Returns:
The last modified date.

setLastModified

public void setLastModified(long lastmodified)
Set the last modified date.

Parameters:
lastmodified - The last modified date.

getFilename

public String getFilename()
Get the filename.

Returns:
The file name.

setFilename

public void setFilename(String filename)
Set the filename.

Parameters:
filename - The file name.

persist

public void persist()
             throws IOException
Persist the cached object.

Throws:
IOException

Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.