| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public synchronized Object | get(final Object
the key whose associated value is to be returned key)Overrides java. Implements java. |
| protected synchronized boolean | removeEldestEntry(final Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns eldesttrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. |
| public synchronized void | touch(final Object
The key of the element to renew key, final Object A value to newly associate with the key value)Implements org. |
| maxSize | back to summary |
|---|---|
| private final int maxSize | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| LRUProtectionStorage | back to summary |
|---|---|
| public LRUProtectionStorage(final int maxSize) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Performs a shallow clone | |
| get | back to summary |
|---|---|
| public synchronized Object get(final Object key) Overrides java. Implements java. Makes sure the retrieved object is moved to the head of the LRU list
| |
| removeEldestEntry | back to summary |
|---|---|
| protected synchronized boolean removeEldestEntry(final Map. Overrides java. The eldest entry should be removed when we reached the maximum cache size
| |
| touch | back to summary |
|---|---|
| public synchronized void touch(final Object key, final Object value) Implements org. The touch method can be used to renew an element and move it to the from of the LRU queue. | |