View Javadoc

    1   package net.sourceforge.pmd.benchmark;
    2
    3   import net.sourceforge.pmd.Rule;
    4
    5   public class RuleDuration implements Comparable<RuleDuration> {
    6
    7   	public Rule rule;
    8   	public long time;
    9
    10  	public int compareTo(RuleDuration other) {
    11  		if (other.time < time) {
    12  			return -1;
    13  		} else if (other.time > time) {
    14  			return 1;
    15  		}
    16
    17  		return rule.getName().compareTo(other.rule.getName());
    18  	}
    19
    20  	public RuleDuration(long elapsed, Rule rule) {
    21  		this.rule = rule;
    22  		this.time = elapsed;
    23  	}
    24
    25  }