1 23 package fr.dyade.aaa.jndi2.impl; 24 25 public class NamingContextId implements java.io.Serializable { 26 27 private Object factoryId; 28 29 private long localId; 30 31 public NamingContextId(Object factoryId, long localId) { 32 this.factoryId = factoryId; 33 this.localId = localId; 34 } 35 36 public final Object getFactoryId() { 37 return factoryId; 38 } 39 40 public final long getLocalId() { 41 return localId; 42 } 43 44 public int hashCode() { 45 return (int)localId; 46 } 47 48 public boolean equals(Object obj) { 49 if (obj instanceof NamingContextId) { 50 NamingContextId ncid = (NamingContextId)obj; 51 if (ncid.localId != localId) return false; 52 return ncid.factoryId.equals(factoryId); 53 } else { 54 return false; 55 } 56 } 57 58 public String toString() { 59 return factoryId.toString() + '_' + localId; 60 } 61 } 62 | Popular Tags |