package org.warp.cowdb.lists; import it.unimi.dsi.fastutil.longs.LongArrayList; import org.warp.cowdb.EnhancedObject; import org.warp.cowdb.IDatabase; import org.warp.jcwdb.ann.DBDataType; import org.warp.jcwdb.ann.DBField; import java.io.IOException; public class EnhancedObjectCowList extends CowList { @DBField(id = 0, type = DBDataType.REFERENCES_LIST) private LongArrayList indices; @DBField(id = 1, type = DBDataType.OBJECT) private Class type; @Override protected LongArrayList getIndices() { return indices; } public EnhancedObjectCowList() { super(); } public EnhancedObjectCowList(IDatabase database, Class type) throws IOException { super(database); this.type = type; indices = new LongArrayList(); } @Override protected T loadItem(long uid) throws IOException { return database.getObjectsIO().loadEnhancedObject(uid, type); } @Override protected void writeItemToDisk(long uid, T item) throws IOException { database.getObjectsIO().setEnhancedObject(uid, item); } }