1 11 package org.eclipse.core.internal.indexing; 12 13 public class IndexedStoreObjectPolicy extends AbstractObjectPolicy { 14 15 18 public IndexedStoreObjectPolicy() { 19 super(); 20 } 21 22 27 public StoredObject createObject(Field field, ObjectStore store, ObjectAddress address) throws ObjectStoreException { 28 int offset = StoredObject.TYPE_OFFSET; 29 int length = StoredObject.TYPE_LENGTH; 30 int type = field.subfield(offset, length).getInt(); 31 StoredObject object = null; 32 switch (type) { 33 case IndexAnchor.TYPE : 34 object = new IndexAnchor(field, store, address); 35 break; 36 case IndexNode.TYPE : 37 object = new IndexNode(field, store, address); 38 break; 39 case IndexedStoreContext.TYPE : 40 object = new IndexedStoreContext(field, store, address); 41 break; 42 case BinarySmallObject.TYPE : 43 object = new BinarySmallObject(field, store, address); 44 break; 45 default : 46 throw new ObjectStoreException(ObjectStoreException.ObjectTypeFailure); 47 } 48 return object; 49 } 50 51 } 52 | Popular Tags |