1 19 package org.netbeans.mdr.persistence.btreeimpl.btreestorage; 20 21 import java.io.*; 22 import java.text.*; 23 import java.util.*; 24 import org.netbeans.mdr.persistence.*; 25 import org.netbeans.mdr.persistence.btreeimpl.btreeindex.*; 26 27 31 public class MofidIndex extends NameIndex implements StorageClient { 32 33 34 BtreeStorage storage; 35 36 37 public MofidIndex() { 38 } 39 40 41 public MofidIndex(BtreeStorage storage) { 42 super(); 43 this.storage = storage; 44 } 45 46 49 public synchronized MOFID get(String name)throws StorageException { 50 return (MOFID)getObj(name); 51 } 52 53 59 public synchronized void add(String name, MOFID id) throws StorageException { 60 addObj(name, id); 61 } 62 63 68 protected void writeObjectToStream(Object obj, DataOutputStream strm) 69 throws StorageException { 70 this.storage.writeMOFIDData (strm, (MOFID) obj); 71 } 72 73 78 protected Object readObjectFromStream(DataInputStream strm) 79 throws StorageException { 80 return this.storage.readMOFIDData (strm); 81 } 82 83 84 public void setStorage(Storage storage) { 85 this.storage = ((BtreeStorage)storage); 86 } 87 } 88 89 90 91 | Popular Tags |