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


float match(T o)
o - The object in the cache
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.