ViolationNode.java
01 package net.sourceforge.pmd.lang.dfa.report;
02 
03 import net.sourceforge.pmd.RuleViolation;
04 
05 public class ViolationNode extends AbstractReportNode {
06 
07     private RuleViolation ruleViolation;
08 
09     public ViolationNode(RuleViolation violation) {
10         this.ruleViolation = violation;
11     }
12 
13     public RuleViolation getRuleViolation() {
14         return ruleViolation;
15     }
16 
17     public boolean equalsNode(AbstractReportNode arg0) {
18         if (!(arg0 instanceof ViolationNode)) {
19             return false;
20         }
21 
22         RuleViolation rv = ((ViolationNodearg0).getRuleViolation();
23 
24         return rv.getFilename().equals(getRuleViolation().getFilename()) &&
25           rv.getBeginLine() == getRuleViolation().getBeginLine() &&
26           rv.getVariableName().equals(getRuleViolation().getVariableName());
27     }
28 
29 }