org.xith3d.utility.cache
Interface CacheMatchInterface<T>


public interface CacheMatchInterface<T>

Used by the caching system to find a matching cached item.


Method Summary
 float match(T o)
           
 

Method Detail

match

float match(T o)
Parameters:
o - The object in the cache
Returns:
the match against the specified cache item. The percent that this is a "good" match. zero indicates it is not an acceptable match. 1 means it is a perfect match. All other values between 0 and 1 means it is an acceptable match, but the closer to 1, the better it is.

An example would be a system which cached NIO byte buffers. If these buffers are used briefly and then returned you can save a lot of garbage collection, especially if these are of substantial size (images). The implementation of the catch match interface might look for a cached buffer that was big enough, but which was not overly big.