| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected int | |
| protected boolean | removeEldestEntry(Map.
Overrides java. Returns |
| maxSize | back to summary |
|---|---|
| private final int maxSize | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SimpleCache | back to summary |
|---|---|
| public SimpleCache(int maxSize) | |
| getMaxSize | back to summary |
|---|---|
| protected int getMaxSize() | |
| removeEldestEntry | back to summary |
|---|---|
| protected boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |