Coverage details for com.clustercontrol.performance.rrdtool.util.CollectedDataInfoDateComparator

LineHitsSource
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  */
284public 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         
378956        int ret = 0;
38         
398956        long time1 = ((CollectedDataInfo)o1).getDate().getTime();
408956        long time2 = ((CollectedDataInfo)o2).getDate().getTime();
41         
428956        if (time1 > time2) {
433992            ret = 1;
444964        } else if (time1 < time2) {
454523            ret = -1;
46         }
47         
488956        return ret;
49     }
50  
51 }

this report was generated by version @product.version@ of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.