1 19 20 27 28 package soot.jimple.toolkits.annotation.purity; 29 30 39 public class PurityEdge 40 { 41 private String field; 42 private PurityNode source, target; 43 private boolean inside; 44 45 PurityEdge(PurityNode source, String field, PurityNode target, boolean inside) 46 { 47 this.source = source; 48 this.field = field; 49 this.target = target; 50 this.inside = inside; 51 } 52 53 public String getField() { return field; } 54 public PurityNode getTarget() { return target; } 55 public PurityNode getSource() { return source; } 56 public boolean isInside() { return inside; } 57 58 public int hashCode() 59 { return field.hashCode()+target.hashCode()+source.hashCode()+(inside?69:0); } 60 61 public boolean equals(Object o) 62 { 63 if (!(o instanceof PurityEdge)) return false; 64 PurityEdge e = (PurityEdge)o; 65 return source.equals(e.source) && field.equals(e.field) 66 && target.equals(e.target) && inside==e.inside; 67 } 68 69 public String toString() 70 { 71 if (inside) 72 return source.toString()+" = "+field+" => "+target.toString(); 73 else 74 return source.toString()+" - "+field+" -> "+target.toString(); 75 76 } 77 } 78 79 | Popular Tags |