package net.sourceforge.pain.data.type; import net.sourceforge.pain.data.*; import net.sourceforge.pain.data.prototype.*; import net.sourceforge.pain.db.*; /** * Base class for all resets. * Resets could be located in space(SpaceReset) or not */ public final class Reset extends Role { public static final int RESETTED_PROTOTYPE = 1 + LAST_BASE_FIELD_INDEX; public static final int LAST_RESETTED_OBJECT = 2 + LAST_BASE_FIELD_INDEX; public static final int NFIELDS = 3 + LAST_BASE_FIELD_INDEX; public Reset(PainDB db) { super(db); } public Reset() { } public DbClassSchema provideSchema() { byte types[] = new byte[NFIELDS]; String names[] = new String[NFIELDS]; fillSuperSchema(types, names); types[RESETTED_PROTOTYPE] = DbType.REFERENCE; names[RESETTED_PROTOTYPE] = "resetted_prototype"; types[LAST_RESETTED_OBJECT] = DbType.REFERENCE; names[LAST_RESETTED_OBJECT] = "last_resetted_object"; return new DbClassSchema(types, names); } public PrototypeInfo getResettedPrototype() { return (PrototypeInfo) getReference(RESETTED_PROTOTYPE); } public void setResettedPrototype(PrototypeInfo p) { setReference(RESETTED_PROTOTYPE, p); } public LogicalObject getLastResettedObject() { return (LogicalObject) getReference(LAST_RESETTED_OBJECT); } public void setLastResettedObject(LogicalObject obj) { setReference(LAST_RESETTED_OBJECT, (Role) obj); } }