Interface Cache
- 
- All Known Implementing Classes:
- PropertiesfileCache
 
 public interface CacheA 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.- Since:
- Ant 1.6
- Version:
- 2003-09-13
 
- 
- 
Method SummaryModifier and Type Method Description voiddelete()Deletes the cache.java.lang.Objectget(java.lang.Object key)Returns a value for a given key from the cache.booleanisValid()Checks its prerequisites.java.util.Iterator<java.lang.String>iterator()Returns an iterator over the keys in the cache.voidload()Loads the cache, must handle not existing cache.voidput(java.lang.Object key, java.lang.Object value)Saves a key-value-pair in the cache.voidsave()Saves modification of the cache.
 
- 
- 
- 
Method Detail- 
isValidboolean isValid() Checks its prerequisites.- Returns:
- true if all is ok, otherwise false.
 
 - 
deletevoid delete() Deletes the cache. If file based the file has to be deleted also.
 - 
loadvoid load() Loads the cache, must handle not existing cache.
 - 
savevoid save() Saves modification of the cache.
 - 
getjava.lang.Object get(java.lang.Object key) Returns a value for a given key from the cache.- Parameters:
- key- the key
- Returns:
- the stored value
 
 - 
putvoid put(java.lang.Object key, java.lang.Object value)Saves a key-value-pair in the cache.- Parameters:
- key- the key
- value- the value
 
 - 
iteratorjava.util.Iterator<java.lang.String> iterator() Returns an iterator over the keys in the cache.- Returns:
- An iterator over the keys.
 
 
- 
 
-