Package jadex.commons
Class CachedObject
- java.lang.Object
- 
- jadex.commons.CachedObject
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class CachedObject extends java.lang.Object implements java.io.SerializableA 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
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.io.SerializablecachedobjectThe cached object.protected java.lang.StringfilenameThe filename of the cache.protected longlastmodifiedThe last modified date.
 - 
Constructor SummaryConstructors Constructor Description CachedObject(java.lang.String filename, long lastmodified, java.io.Serializable cachedobject)Create a new file cache.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFilename()Get the filename.longgetLastModified()Get the last modified date.java.io.SerializablegetObject()Get the cached objectvoidpersist()Persist the cached object.voidsetFilename(java.lang.String filename)Set the filename.voidsetLastModified(long lastmodified)Set the last modified date.voidsetObject(java.io.Serializable cachedobject)Set the cached object.
 
- 
- 
- 
Method Detail- 
setObjectpublic void setObject(java.io.Serializable cachedobject) Set the cached object.- Parameters:
- cachedobject- The cached object.
 
 - 
getObjectpublic java.io.Serializable getObject() Get the cached object- Returns:
- The cached object.
 
 - 
getLastModifiedpublic long getLastModified() Get the last modified date.- Returns:
- The last modified date.
 
 - 
setLastModifiedpublic void setLastModified(long lastmodified) Set the last modified date.- Parameters:
- lastmodified- The last modified date.
 
 - 
getFilenamepublic java.lang.String getFilename() Get the filename.- Returns:
- The file name.
 
 - 
setFilenamepublic void setFilename(java.lang.String filename) Set the filename.- Parameters:
- filename- The file name.
 
 - 
persistpublic void persist() throws java.io.IOExceptionPersist the cached object.- Throws:
- java.io.IOException
 
 
- 
 
-