View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.benchmark;
5   
6   import net.sourceforge.pmd.Rule;
7   
8   public class RuleDuration implements Comparable<RuleDuration> {
9   
10  	public Rule rule;
11  	public long time;
12  
13  	public int compareTo(RuleDuration other) {
14  		if (other.time < time) {
15  			return -1;
16  		} else if (other.time > time) {
17  			return 1;
18  		}
19  
20  		return rule.getName().compareTo(other.rule.getName());
21  	}
22  
23  	public RuleDuration(long elapsed, Rule rule) {
24  		this.rule = rule;
25  		this.time = elapsed;
26  	}
27  
28  }