1 17 package org.apache.bcel.generic; 18 19 import org.apache.bcel.Constants; 20 21 28 public class ReturnaddressType extends Type { 29 30 public static final ReturnaddressType NO_TARGET = new ReturnaddressType(); 31 private InstructionHandle returnTarget; 32 33 34 37 private ReturnaddressType() { 38 super(Constants.T_ADDRESS, "<return address>"); 39 } 40 41 42 45 public ReturnaddressType(InstructionHandle returnTarget) { 46 super(Constants.T_ADDRESS, "<return address targeting " + returnTarget + ">"); 47 this.returnTarget = returnTarget; 48 } 49 50 51 53 public int hashCode() { 54 if (returnTarget == null) { 55 return 0; 56 } 57 return returnTarget.hashCode(); 58 } 59 60 61 64 public boolean equals( Object rat ) { 65 if (!(rat instanceof ReturnaddressType)) { 66 return false; 67 } 68 ReturnaddressType that = (ReturnaddressType) rat; 69 if (this.returnTarget == null || that.returnTarget == null) { 70 return that.returnTarget == this.returnTarget; 71 } 72 return that.returnTarget.equals(this.returnTarget); 73 } 74 75 76 79 public InstructionHandle getTarget() { 80 return returnTarget; 81 } 82 } 83 | Popular Tags |