public class LRUCache<E,T> extends Object
| Constructor and Description |
|---|
LRUCache(int capacity) |
LRUCache(int capacity,
int percentToRemove) |
| Modifier and Type | Method and Description |
|---|---|
T |
get(E key)
get a element from map with specified key
|
int |
getLength()
return the length of list
|
void |
printList()
print the list
|
void |
remove(E key)
remove a element from list
|
void |
removeLeastUsedElements() |
void |
set(E key,
T value)
set a element to list
|
public LRUCache(int capacity)
public LRUCache(int capacity,
int percentToRemove)
public void remove(E key)
key - public void removeLeastUsedElements()
public int getLength()
public void printList()
Copyright © 2016. All Rights Reserved.