Last change
on this file since 10808 was
10808,
checked in by mlg, 13 years ago
|
Adds a maximum size for the cache
Will limit memory consumption.
|
File size:
534 bytes
|
Rev | Line | |
---|
[10808] | 1 | package fr.mael.jiwigo.transverse; |
---|
| 2 | |
---|
| 3 | import java.util.Comparator; |
---|
| 4 | import java.util.Map; |
---|
| 5 | |
---|
| 6 | public class CacheObjectManagementComparator implements Comparator<Object> { |
---|
| 7 | |
---|
| 8 | @Override |
---|
| 9 | public int compare(Object paramT1, Object paramT2) { |
---|
| 10 | Map.Entry e1 = (Map.Entry) paramT1; |
---|
| 11 | Map.Entry e2 = (Map.Entry) paramT2; |
---|
| 12 | CacheObjectManagement first = (CacheObjectManagement) e1.getValue(); |
---|
| 13 | CacheObjectManagement second = (CacheObjectManagement) e2.getValue(); |
---|
| 14 | return first.getLastAccessDate().compareTo(second.getLastAccessDate()); |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.