Class CachedObject

java.lang.Object
jadex.collection.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:
  • Field Details

    • cachedobject

      protected Serializable cachedobject
      The cached object.
    • filename

      protected String filename
      The filename of the cache.
    • lastmodified

      protected long lastmodified
      The last modified date.
  • Constructor Details

    • CachedObject

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

    • 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