Line | Hits | Source |
---|---|---|
1 | /* | |
2 | ||
3 | Copyright (C) 2008 NTT DATA Corporation | |
4 | ||
5 | This program is free software; you can redistribute it and/or | |
6 | Modify it under the terms of the GNU General Public License | |
7 | as published by the Free Software Foundation, version 2. | |
8 | ||
9 | This program is distributed in the hope that it will be | |
10 | useful, but WITHOUT ANY WARRANTY; without even the implied | |
11 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
12 | PURPOSE. See the GNU General Public License for more details. | |
13 | ||
14 | */ | |
15 | ||
16 | package com.clustercontrol.performance.rrdtool.util; | |
17 | ||
18 | import java.util.Comparator; | |
19 | ||
20 | import com.clustercontrol.performance.bean.CollectedDataInfo; | |
21 | ||
22 | /** | |
23 | * Hinemos Addon for RRDTool<br> | |
24 | * 収集性能値オブジェクトを日付で比?するクラス<br> | |
25 | * | |
26 | * @since 3.0.0 | |
27 | */ | |
28 | 4 | public class CollectedDataInfoDateComparator implements Comparator { |
29 | ||
30 | /** | |
31 | * 日付でオブジェクト?大小を比?する?<br> | |
32 | * | |
33 | * @return o1のほ?が最新であれば1、同じ日時であれば0、古ければ-1 | |
34 | */ | |
35 | public int compare(Object o1, Object o2) { | |
36 | ||
37 | 1580 | int ret = 0; |
38 | ||
39 | 1580 | long time1 = ((CollectedDataInfo)o1).getDate().getTime(); |
40 | 1580 | long time2 = ((CollectedDataInfo)o2).getDate().getTime(); |
41 | ||
42 | 1580 | if (time1 > time2) { |
43 | 0 | ret = 1; |
44 | 1580 | } else if (time1 < time2) { |
45 | 1273 | ret = -1; |
46 | } | |
47 | ||
48 | 1580 | return ret; |
49 | } | |
50 | ||
51 | } |
this report was generated by version @product.version@ of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |