gov.nasa.worldwind.cache.SessionCache Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2012 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/
package gov.nasa.worldwind.cache;
/**
* SessionCache is a general receiving area for data represented as key-value pairs. Entries in a SessionCache may
* persist for the length of a Virtual Machine's run time, but may be evicted at any time.
*
* Eviction of SessionCache entries is accomplished by controlling the maximum number of entries in the cache. This
* maximum value is set by calling {@link #setCapacity(int)}. A SessionCache may be implemented with any eviction policy
* (including a policy of no eviction). Most implementations evict the eldest entry added to the cache.
*
* @author dcollins
* @version $Id: SessionCache.java 1171 2013-02-11 21:45:02Z dcollins $
*/
public interface SessionCache
{
/**
* Returns the maximum number of entries in the cache.
*
* @return maximum number of entries in the cache.
*/
int getCapacity();
/**
* Sets the maximum number of entries in the cache.
*
* @param capacity maximum number of enties in the cache.
*/
void setCapacity(int capacity);
/**
* Returns the number of entries currently in the cache.
*
* @return number of cached entries.
*/
int getEntryCount();
/**
* Returns a {@link java.util.Set} view of the keys contained in the cache.
*
* @return a {@link java.util.Set} view of the keys contained in the cache.
*/
java.util.Set
© 2015 - 2024 Weber Informatics LLC | Privacy Policy