All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gaixie.cache.Cacheable Maven / Gradle / Ivy

The newest version!
package org.gaixie.cache;

/**
 * Interface that defines the necessary behavior for objects added to a Cache.
 * Objects only need to know how big they are (in bytes). That size
 * should be considered to be a best estimate of how much memory the Object
 * occupies and may be based on empirical trials or dynamic calculations.

* * While the accuracy of the size calculation is important, care should be * taken to minimize the computation time so that cache operations are * speedy. * * @see org.gaixie.cache.Cache */ public interface Cacheable extends java.io.Serializable { /** * Returns the approximate size of the Object in bytes. The size should be * considered to be a best estimate of how much memory the Object occupies * and may be based on empirical trials or dynamic calculations.

* * @return the size of the Object in bytes. */ public int getCachedSize(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy