1 21 package com.db4o.defragment; 22 23 import com.db4o.foundation.*; 24 25 26 31 abstract class AbstractContextIDMapping implements ContextIDMapping { 32 33 private Hashtable4 _classIDs = new Hashtable4(); 34 35 public final void mapIDs(int origID, int mappedID, boolean isClassID) { 36 if(isClassID) { 37 mapClassIDs(origID, mappedID); 38 return; 39 } 40 mapNonClassIDs(origID, mappedID); 41 } 42 43 protected int mappedClassID(int origID) { 44 Object obj = _classIDs.get(origID); 45 if(obj == null){ 46 return 0; 47 } 48 return ((Integer )obj).intValue(); 49 } 50 51 private void mapClassIDs(int oldID, int newID) { 52 _classIDs.put(oldID,new Integer (newID)); 53 } 54 55 protected abstract void mapNonClassIDs(int origID,int mappedID); 56 } 57 | Popular Tags |