org.apache.tools.ant.types.selectors.modifiedselector
Interface Cache
- PropertiesfileCache
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:
- Ant 1.6
void | delete() - Deletes the cache.
|
Object | get(Object key) - Returns a value for a given key from the cache.
|
boolean | isValid() - Checks its prerequisites.
|
Iterator | iterator() - Returns an iterator over the keys in the cache.
|
void | load() - Loads the cache, must handle not existing cache.
|
void | put(Object key, Object value) - Saves a key-value-pair in the cache.
|
void | save() - Saves modification of the cache.
|
delete
public void delete()
Deletes the cache. If file based the file has to be deleted also.
get
public Object get(Object key)
Returns a value for a given key from the cache.
key
- the key
- the stored value
isValid
public boolean isValid()
Checks its prerequisites.
- true if all is ok, otherwise false.
iterator
public Iterator iterator()
Returns an iterator over the keys in the cache.
- An iterator over the keys.
load
public void load()
Loads the cache, must handle not existing cache.
put
public void put(Object key,
Object value)
Saves a key-value-pair in the cache.
key
- the keyvalue
- the value
save
public void save()
Saves modification of the cache.
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.