1 package edu.rice.rubis.beans; 2 3 10 public class IDManagerPK implements java.io.Serializable { 11 12 public Integer id; 13 14 19 public IDManagerPK() 20 { 21 id = new Integer (0); 22 } 23 24 29 public IDManagerPK(Integer uniqueId) 30 { 31 id = uniqueId; 32 } 33 34 39 public int hashCode() 40 { 41 if (id == null) 42 return 0; 43 else 44 return id.intValue(); 45 } 46 47 53 public boolean equals(Object other) 54 { 55 boolean isEqual = false; 56 if (other instanceof IDManagerPK) 57 { 58 if (id == null) 59 isEqual = (id == ((IDManagerPK)other).id); 60 else 61 isEqual = (id.intValue() == ((IDManagerPK)other).id.intValue()); 62 } 63 return isEqual; 64 } 65 66 } 67 | Popular Tags |