Jadex 0.96-beta1

jadex.util
Class ObjectCache

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

public class ObjectCache
extends Object
implements Serializable

A cache for CachedObjects that reflect files. A cached object is loaded per filename (not the filename of the held object in the cache).

See Also:
Serialized Form

Constructor Summary
ObjectCache(String filename)
          Create a new cache.
ObjectCache(String filename, boolean persist_always, boolean persist_single)
          Create a new cache.
ObjectCache(String filename, boolean persist_always, boolean persist_single, int max)
          Create a new cache.
 
Method Summary
 void add(CachedObject co)
          Add a cached object.
 void clear()
          Clear the cache.
 CachedObject loadCachedObject(String filename, long lastmodified)
          Load the cached file.
static ObjectCache loadObjectCache(String filename)
          Load the model cache.
 void persist()
          Presist the cached object.
 void remove(String filename)
          Add a cached object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCache

public ObjectCache(String filename)
Create a new cache.


ObjectCache

public ObjectCache(String filename,
                   boolean persist_always,
                   boolean persist_single)
Create a new cache.


ObjectCache

public ObjectCache(String filename,
                   boolean persist_always,
                   boolean persist_single,
                   int max)
Create a new cache.

Method Detail

loadCachedObject

public CachedObject loadCachedObject(String filename,
                                     long lastmodified)
Load the cached file.

Parameters:
filename - The filename of the cached object.
lastmodified - The last modified date important for the up-to-date check. -1 for do not check.

add

public void add(CachedObject co)
Add a cached object.

Parameters:
co - The new object.

remove

public void remove(String filename)
Add a cached object.

Parameters:
filename - The filename.

persist

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

Throws:
IOException

clear

public void clear()
Clear the cache.


loadObjectCache

public static ObjectCache loadObjectCache(String filename)
Load the model cache.

Parameters:
filename - The filename.
Returns:
The object cache.

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.