1 2 12 package com.versant.core.jdo.tools.enhancer.utils; 13 14 import com.versant.lib.bcel.generic.InstructionHandle; 15 16 19 public class TableSwitchHelper implements Comparable { 20 public int match; 21 public InstructionHandle target; 22 26 public int compareTo(Object o){ 27 TableSwitchHelper other = (TableSwitchHelper)o; 28 if (match == other.match){ 29 return 0; 30 } else if (match < other.match){ 31 return -1; 32 } else { 33 return 1; 34 } 35 } 36 37 public boolean equals(Object other){ 38 if (other != null && getClass() == other.getClass()){ 39 TableSwitchHelper otherTableSwitchHelper = (TableSwitchHelper)other; 40 return match == otherTableSwitchHelper.match; 41 } else { 42 return false; 43 } 44 } 45 46 public int hashCode(){ 47 Integer i = new Integer (match); 48 return 13 * i.hashCode(); 49 } 50 } 51 | Popular Tags |