01: /**
02: *
03: */package clime.messadmin.servletstats;
04:
05: import java.util.Comparator;
06:
07: import clime.messadmin.model.RequestInfo;
08:
09: /**
10: * @author Cédrik LIME
11: */
12: public class RequestInfoTimeComparator implements Comparator {
13:
14: /**
15: *
16: */
17: public RequestInfoTimeComparator() {
18: super ();
19: }
20:
21: /**
22: * {@inheritDoc}
23: */
24: public int compare(Object o1, Object o2) {
25: RequestInfo ri1 = (RequestInfo) o1;
26: RequestInfo ri2 = (RequestInfo) o2;
27: return (int) (ri2.getTotalUsedTime() - ri1.getTotalUsedTime());
28: }
29:
30: /**
31: * {@inheritDoc}
32: */
33: public boolean equals(Object obj) {
34: return (obj instanceof RequestInfoTimeComparator)
35: && this.getClass().equals(obj.getClass());
36: }
37: }
|