1 21 package com.db4o.foundation; 22 23 26 class HashtableIntEntry implements DeepClone { 27 28 int i_key; 29 30 Object i_object; 31 32 HashtableIntEntry i_next; 33 34 HashtableIntEntry(int a_hash, Object a_object) { 35 i_key = a_hash; 36 i_object = a_object; 37 } 38 39 protected HashtableIntEntry() { 40 } 41 42 public void acceptKeyVisitor(Visitor4 visitor) { 43 visitor.visit(new Integer (i_key)); 44 } 45 46 public Object deepClone(Object obj) { 47 return deepCloneInternal(new HashtableIntEntry(), obj); 48 } 49 50 public boolean sameKeyAs(HashtableIntEntry other) { 51 return i_key == other.i_key; 52 } 53 54 protected HashtableIntEntry deepCloneInternal(HashtableIntEntry entry, Object obj) { 55 entry.i_key = i_key; 56 entry.i_next = i_next; 57 if (i_object instanceof DeepClone) { 58 entry.i_object = ((DeepClone) i_object).deepClone(obj); 59 } else { 60 entry.i_object = i_object; 61 } 62 if (i_next != null) { 63 entry.i_next = (HashtableIntEntry) i_next.deepClone(obj); 64 } 65 return entry; 66 } 67 } 68 | Popular Tags |