org.apache.mahout.common.cache
Interface Cache<K,V>

All Known Implementing Classes:
HybridCache, LeastKCache, LFUCache, LRUCache

public interface Cache<K,V>


Method Summary
 long capacity()
          returns the total capacity of the cache defined at contruction time
 boolean contains(K key)
          returns true if the Cache contains the key
 V get(K key)
          Gets the Value from the Cache, If the object doesnt exist default behaviour is to return null.
 void set(K key, V value)
          puts the key and its value into the cache
 long size()
          returns the current size of the cache
 

Method Detail

get

V get(K key)
Gets the Value from the Cache, If the object doesnt exist default behaviour is to return null.

Parameters:
key -
Returns:
V

contains

boolean contains(K key)
returns true if the Cache contains the key

Parameters:
key -
Returns:
boolean

set

void set(K key,
         V value)
puts the key and its value into the cache

Parameters:
key -
value -

size

long size()
returns the current size of the cache

Returns:
long

capacity

long capacity()
returns the total capacity of the cache defined at contruction time

Returns:
long


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.