org.jcreme.filters
Interface FilterCache

All Known Implementing Classes:
NaiveFilterCache

public interface FilterCache

This interface describes a FilterCache. FilterCache implementations enable to track the Filters. Basically they provide the means to know if a filter was used, if the objects currently available in the application cover the Filter. For instance it can be used in Cache implementations to avoid a call to a database or to a remote server while the needed objects are already locally available.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Method Summary
 Filter[] getFilters()
          Enables access to the filters stored in this instance.
 void invalidate(Filter filter)
          "Invalidates" the given filter.
 void invalidate(java.lang.Object obj)
          Invalidates all the filters contained in this class that "accept" the object.
 void invalidateAll()
          Invalidate all the filters contained in this instance.
 boolean isValid(Filter filter)
          Tells whether a filter is a "valid" one.
 void validate(Filter filter)
          Tags the given filter as "valid".
 boolean validates(java.lang.Object obj)
          This method enables to test whether an Object is accepted by at least one of the Caches present in the FilterCache.
 

Method Detail

getFilters

public Filter[] getFilters()
Enables access to the filters stored in this instance.

Returns:
the filters stored.

isValid

public boolean isValid(Filter filter)
Tells whether a filter is a "valid" one. A valid filter is simply a Filter that was registered in the FilterCache.

Parameters:
filter - The Filter object we want to know about.
Returns:
True if the passed in filter is valid, false otherwise.

validate

public void validate(Filter filter)
Tags the given filter as "valid".

Parameters:
filter - The filter we want to set as "valid".

invalidate

public void invalidate(Filter filter)
"Invalidates" the given filter. This means that the Filter is removed from the FilterCache.

Parameters:
filter - The Filter object we want to invalidate.

invalidate

public void invalidate(java.lang.Object obj)
Invalidates all the filters contained in this class that "accept" the object.

Parameters:
obj - the object to be tested against the Filters present in this FilterCache.

invalidateAll

public void invalidateAll()
Invalidate all the filters contained in this instance.


validates

public boolean validates(java.lang.Object obj)
This method enables to test whether an Object is accepted by at least one of the Caches present in the FilterCache.

Parameters:
obj - the object to be tested against the Filters present in this FilterCache.
Returns:
true if the object would invalidate a filter contained in this class.


Copyright 2006 null. All Rights Reserved.