1 19 20 25 26 package soot.jimple.toolkits.annotation.arraycheck; 27 28 import soot.*; 29 import soot.toolkits.scalar.*; 30 import soot.util.*; 31 import java.util.*; 32 33 class FlowGraphEdge 34 { 35 Object from; 36 Object to; 37 38 public FlowGraphEdge() 39 { 40 this.from = null; 41 this.to = null; 42 } 43 44 public FlowGraphEdge(Object from, Object to) 45 { 46 this.from = from; 47 this.to = to; 48 } 49 50 public int hashCode() 51 { 52 return this.from.hashCode()^this.to.hashCode(); 53 } 54 55 public Object getStartUnit() 56 { 57 return this.from; 58 } 59 60 public Object getTargetUnit() 61 { 62 return this.to; 63 } 64 65 public void changeEndUnits(Object from, Object to) 66 { 67 this.from = from; 68 this.to = to; 69 } 70 71 public boolean equals(Object other) 72 { 73 if (other == null) 74 return false; 75 76 if (other instanceof FlowGraphEdge) 77 { 78 Object otherstart = ((FlowGraphEdge)other).getStartUnit(); 79 Object othertarget = ((FlowGraphEdge)other).getTargetUnit(); 80 81 return (this.from.equals(otherstart)&&this.to.equals(othertarget)); 82 } 83 else 84 return false; 85 } 86 } 87 | Popular Tags |