org.scoja.util
Class ExpiringLRUCache.Shell

java.lang.Object
org.scoja.util.ExpiringLRUCache.Shell
- All Implemented Interfaces:
- LRUShell
- Enclosing class:
- ExpiringLRUCache
- private class ExpiringLRUCache.Shell
- extends java.lang.Object
- implements LRUShell
key
protected final java.lang.Object key
value
protected ExpiringObject value
computing
protected boolean computing
usages
protected int usages
lastUsage
protected long lastUsage
prev
protected ExpiringLRUCache.Shell prev
next
protected ExpiringLRUCache.Shell next
ExpiringLRUCache.Shell
public ExpiringLRUCache.Shell()
ExpiringLRUCache.Shell
public ExpiringLRUCache.Shell(java.lang.Object key)
getUsage
protected int getUsage()
getLastUsageTime
protected long getLastUsageTime()
addUsage
protected void addUsage()
removeUsage
protected void removeUsage()
getPrevious
protected ExpiringLRUCache.Shell getPrevious()
getNext
protected ExpiringLRUCache.Shell getNext()
unlink
protected void unlink()
linkAfter
protected void linkAfter(ExpiringLRUCache.Shell befo)
getCurrentValue
protected ExpiringObject getCurrentValue()
getKey
public java.lang.Object getKey()
- Description copied from interface:
LRUShell
- Devuelve la clave a la que está asociado este objeto.
Generalmente es un dato redundante, porque se tuvo que conocer
para poder buscar este objeto en una cache.
- Specified by:
getKey in interface LRUShell
getValue
public ExpiringObject getValue()
- Description copied from interface:
LRUShell
- Devuelve el valor que contiene este objeto y que se supone que
es el valor para la clave
LRUShell.getKey() 55 .
Cuando este objeto no tiene valor asociado, la primera llamada
devuelve null y las siguiente se quedan bloqueadas
hasta que la primera llama a LRUShell.put(ExpiringObject) 55 o
LRUShell.release() 55 .
- Specified by:
getValue in interface LRUShell
put
public void put(ExpiringObject value)
throws java.lang.IllegalStateException
- Description copied from interface:
LRUShell
- Pone el valor a
value, cuando el objeto está
indefinido.
Pero produce una excepción java.lang.IllegalStateException si ya
había recibido un valor.
- Specified by:
put in interface LRUShell
release
public void release()
- Description copied from interface:
LRUShell
- Indica a la caché de la que lo hemos sacado que ya no lo
estamos usando y que, por nosotros, puede empezar a pensar en
su muerte.
- Specified by:
release in interface LRUShell
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).