package org.warp.cowdb; import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.longs.LongList; import org.warp.jcwdb.ann.DBDataType; import java.io.IOException; import java.lang.reflect.Method; public interface IObjectsIO { T loadEnhancedObject(long reference, Class objectType) throws IOException; T loadObject(long reference) throws IOException; LongArrayList loadReferencesList(long reference) throws IOException; void setEnhancedObject(long reference, T value) throws IOException; void setObject(long reference, T value) throws IOException; void setReferencesList(long reference, LongArrayList value) throws IOException; long newNullObject() throws IOException; default long newEnhancedObject(T value) throws IOException { long reference = newNullObject(); if (value != null) { setEnhancedObject(reference, value); } return reference; } default long newObject(T value) throws IOException { long reference = newNullObject(); if (value != null) { setObject(reference, value); } return reference; } default long newReferencesList(LongArrayList value) throws IOException { long reference = newNullObject(); if (value != null) { setReferencesList(reference, value); } return reference; } void loadProperty(EnhancedObject enhancedObject, int propertyId, Method propertyGetter, DBDataType propertyType, long propertyUID) throws IOException; void registerClass(Class type, int id); IDataInitializer getDataInitializer(); LongList loadPrimitiveData(long id) throws IOException; }