KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > dfa > report > ViolationNode


1 package net.sourceforge.pmd.dfa.report;
2
3 import net.sourceforge.pmd.IRuleViolation;
4
5 public class ViolationNode extends AbstractReportNode {
6
7     private IRuleViolation ruleViolation;
8
9     public ViolationNode(IRuleViolation violation) {
10         this.ruleViolation = violation;
11     }
12
13     public IRuleViolation getRuleViolation() {
14         return ruleViolation;
15     }
16
17     public boolean equalsNode(AbstractReportNode arg0) {
18         if (!(arg0 instanceof ViolationNode)) {
19             return false;
20         }
21
22         IRuleViolation rv = ((ViolationNode) arg0).getRuleViolation();
23
24         return rv.getFilename().equals(getRuleViolation().getFilename()) &&
25             rv.getBeginLine() == getRuleViolation().getBeginLine() &&
26             rv.getVariableName().equals(getRuleViolation().getVariableName());
27     }
28
29 }
30
Popular Tags