Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl.util
Class LruCache

    java.lang.Object
      org.ensembl.util.LruCache

public class LruCache
extends java.lang.Object

Author:
  arne Should behave like a Hashtable but as well like an LRU cache Objects which are put in are expected to be put in under more than one key, so the keys for an objects will be tracked

Constructor Summary
`LruCache(int maxSize)`

Method Summary
`void` | `clear()`
`java.lang.Object` | `get(long key)` Convenience method that converts long to Long for storage.
`java.lang.Object` | `get(java.lang.Object key)`
`int` | `getSize()`
`java.util.Set` | `keys()`
`int` | `listSize()`
`void` | `put(java.lang.Object value, long key)` Convenience method that converts long to Long for storage.
`void` | `put(java.lang.Object value, java.lang.Object key)`
`void` | `put(java.lang.Object value, java.lang.Object key1, java.lang.Object key2)`
`void` | `put(java.lang.Object value, java.lang.Object key1, java.lang.Object key2, java.lang.Object key3)`
`java.lang.Object` | `removeValue(java.lang.Object value)`
`java.lang.Object` | `removeValueByKey(java.lang.Object key)`
`java.lang.String` | `toString()`
`java.util.Collection` | `values()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### LruCache

    public LruCache(int maxSize)

Method Detail

### get

    public java.lang.Object get(long key)

  Convenience method that converts long to Long for storage.

  Parameters:
    `key` - key for value in map.
  Returns:
    value if present, otherwise null.

### get

    public java.lang.Object get(java.lang.Object key)

### put

    public void put(java.lang.Object value,
                    long key)

  Convenience method that converts long to Long for storage.

  Parameters:
    `value` - value to be stored.
    `key` - key for value in map.

### put

    public void put(java.lang.Object value,
                    java.lang.Object key)

### removeValue

    public java.lang.Object removeValue(java.lang.Object value)

### removeValueByKey

    public java.lang.Object removeValueByKey(java.lang.Object key)

### put

    public void put(java.lang.Object value,
                    java.lang.Object key1,
                    java.lang.Object key2)

### put

    public void put(java.lang.Object value,
                    java.lang.Object key1,
                    java.lang.Object key2,
                    java.lang.Object key3)

### getSize

    public int getSize()

### listSize

    public int listSize()

### toString

    public java.lang.String toString()

### clear

    public void clear()

### values

    public java.util.Collection values()

### keys

    public java.util.Set keys()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD