FileDocCategorySizeDatePackage
Cache.javaAPI DocApache Ant 1.702142Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types.selectors.modifiedselector

Cache

public interface Cache
A Cache let the user store key-value-pairs in a permanent manner and access them. It is possible that a client uses get() before load() therefore the implementation must ensure that no error occurred because of the wrong order. The implementing class should implement a useful toString() method.
version
2003-09-13
since
Ant 1.6

Fields Summary
Constructors Summary
Methods Summary
public voiddelete()
Deletes the cache. If file based the file has to be deleted also.

public java.lang.Objectget(java.lang.Object key)
Returns a value for a given key from the cache.

param
key the key
return
the stored value

public booleanisValid()
Checks its prerequisites.

return
true if all is ok, otherwise false.

public java.util.Iteratoriterator()
Returns an iterator over the keys in the cache.

return
An iterator over the keys.

public voidload()
Loads the cache, must handle not existing cache.

public voidput(java.lang.Object key, java.lang.Object value)
Saves a key-value-pair in the cache.

param
key the key
param
value the value

public voidsave()
Saves modification of the cache.