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.apache.openjpa.lib.util
Class LRUMap

    java.lang.Object
      java.util.AbstractMap
          org.apache.commons.collections.map.AbstractHashedMap
              org.apache.commons.collections.map.AbstractLinkedMap
                  org.apache.commons.collections.map.LRUMap
                      org.apache.openjpa.lib.util.LRUMap

All Implemented Interfaces:
  Serializable, Cloneable, Map, org.apache.commons.collections.BoundedMap, org.apache.commons.collections.IterableMap, org.apache.commons.collections.OrderedMap, SizedMap

    public class LRUMap

extends org.apache.commons.collections.map.LRUMap
implements SizedMap

Extension of the commons `LRUMap` that can change its maximum size.

Author:
  Abe White
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractLinkedMap
`org.apache.commons.collections.map.AbstractLinkedMap.EntrySetIterator, org.apache.commons.collections.map.AbstractLinkedMap.KeySetIterator, org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry, org.apache.commons.collections.map.AbstractLinkedMap.LinkIterator, org.apache.commons.collections.map.AbstractLinkedMap.LinkMapIterator, org.apache.commons.collections.map.AbstractLinkedMap.ValuesIterator`

Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractHashedMap
`org.apache.commons.collections.map.AbstractHashedMap.EntrySet, org.apache.commons.collections.map.AbstractHashedMap.HashEntry, org.apache.commons.collections.map.AbstractHashedMap.HashIterator, org.apache.commons.collections.map.AbstractHashedMap.HashMapIterator, org.apache.commons.collections.map.AbstractHashedMap.KeySet, org.apache.commons.collections.map.AbstractHashedMap.Values`

Nested classes/interfaces inherited from class java.util.AbstractMap
`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

Nested classes/interfaces inherited from interface java.util.Map
`Map.Entry<K,V>`

Field Summary

Fields inherited from class org.apache.commons.collections.map.LRUMap
`DEFAULT_MAX_SIZE`

Fields inherited from class org.apache.commons.collections.map.AbstractLinkedMap
`header`

Fields inherited from class org.apache.commons.collections.map.AbstractHashedMap
`data, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, entrySet, GETKEY_INVALID, GETVALUE_INVALID, keySet, loadFactor, MAXIMUM_CAPACITY, modCount, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID, size, threshold, values`

Constructor Summary
`LRUMap()`
`LRUMap(int initCapacity)`
`LRUMap(int initCapacity, float loadFactor)`
`LRUMap(Map map)`

Method Summary
`protected void` | `doReadObject(ObjectInputStream in)`
`protected void` | `doWriteObject(ObjectOutputStream out)`
`int` | `getMaxSize()` The maximum number of entries, or Integer.MAX_VALUE for no limit.
`boolean` | `isFull()` Whether the map is full.
`int` | `maxSize()`
`void` | `overflowRemoved(Object key, Object value)` Overridable callback for when an overflow entry is automatically removed.
`protected boolean` | `removeLRU(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry entry)`
`void` | `setMaxSize(int max)` The maximum number of entries, or Integer.MAX_VALUE for no limit.

Methods inherited from class org.apache.commons.collections.map.LRUMap
`addMapping, clone, get, isScanUntilRemovable, moveToMRU, reuseMapping, updateEntry`

Methods inherited from class org.apache.commons.collections.map.AbstractLinkedMap
`addEntry, clear, containsValue, createEntry, createEntrySetIterator, createKeySetIterator, createValuesIterator, entryAfter, entryBefore, firstKey, getEntry, init, lastKey, mapIterator, nextKey, orderedMapIterator, previousKey, removeEntry`

Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap
`calculateNewCapacity, calculateThreshold, checkCapacity, containsKey, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entrySet, entryValue, equals, getEntry, hash, hashCode, hashIndex, isEmpty, isEqualKey, isEqualValue, keySet, put, putAll, remove, removeMapping, reuseEntry, size, toString, values`

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

Methods inherited from interface java.util.Map
`clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

Constructor Detail

### LRUMap

    public LRUMap()

### LRUMap

    public LRUMap(int initCapacity)

### LRUMap

    public LRUMap(int initCapacity,
                  float loadFactor)

### LRUMap

    public LRUMap(Map map)

Method Detail

### getMaxSize

    public int getMaxSize()

  Description copied from interface: `SizedMap`
  The maximum number of entries, or Integer.MAX_VALUE for no limit.

  Specified by:
    `getMaxSize` in interface `SizedMap`

### setMaxSize

    public void setMaxSize(int max)

  Description copied from interface: `SizedMap`
  The maximum number of entries, or Integer.MAX_VALUE for no limit.

  Specified by:
    `setMaxSize` in interface `SizedMap`

### overflowRemoved

    public void overflowRemoved(Object key,
                                Object value)

  Description copied from interface: `SizedMap`
  Overridable callback for when an overflow entry is automatically removed.

  Specified by:
    `overflowRemoved` in interface `SizedMap`

### maxSize

    public int maxSize()

  Specified by:
    `maxSize` in interface `org.apache.commons.collections.BoundedMap`
  Overrides:
    `maxSize` in class `org.apache.commons.collections.map.LRUMap`

### isFull

    public boolean isFull()

  Description copied from interface: `SizedMap`
  Whether the map is full.

  Specified by:
    `isFull` in interface `org.apache.commons.collections.BoundedMap`
  Specified by:
    `isFull` in interface `SizedMap`
  Overrides:
    `isFull` in class `org.apache.commons.collections.map.LRUMap`

### removeLRU

    protected boolean removeLRU(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry entry)

  Overrides:
    `removeLRU` in class `org.apache.commons.collections.map.LRUMap`

### doWriteObject

    protected void doWriteObject(ObjectOutputStream out)
                          throws IOException

  Overrides:
    `doWriteObject` in class `org.apache.commons.collections.map.LRUMap`
  Throws:
    `IOException`

### doReadObject

    protected void doReadObject(ObjectInputStream in)
                         throws IOException,
                                ClassNotFoundException

  Overrides:
    `doReadObject` in class `org.apache.commons.collections.map.LRUMap`
  Throws:
    `IOException`
    `ClassNotFoundException`

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

Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.