added removeAll method to cache

This commit is contained in:
Sebastian Sdorra
2011-11-07 12:49:39 +01:00
parent fc90b92b97
commit 8a7091398b
3 changed files with 213 additions and 2 deletions

View File

@@ -33,9 +33,13 @@
package sonia.scm.cache;
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.Filter;
/**
* The main interface for the cache.
* Provides methods to add, access, and remove entries from a cache.
* The main interface for the cache.
* Provides methods to add, access, and remove entries from a cache.
*
* @author Sebastian Sdorra
*
@@ -81,6 +85,18 @@ public interface Cache<K, V>
*/
public boolean remove(K key);
/**
* Remove all elements with matching {@link Filter} from this cache.
* The method returns true if the operation was successful.
*
* @since 1.9
*
* @param filter - The filter to match cache keys
*
* @return true if the operation was successful
*/
public boolean removeAll(Filter<K> filter);
//~--- get methods ----------------------------------------------------------
/**