/** * Main method. * * @param args should contain the options of a Saver. */ public static void main(String[] args) { runFileSaver(new SerializedInstancesSaver(), args); } }
/** Constructor. */ public SerializedInstancesSaver(){ resetOptions(); }
/** * Writes a Batch of instances. * * @throws IOException throws IOException if saving in batch mode is not possible */ public void writeBatch() throws IOException { if(getRetrieval() == INCREMENTAL) throw new IOException("Batch and incremental saving cannot be mixed."); if(getInstances() == null) throw new IOException("No instances to save"); setRetrieval(BATCH); if (m_objectstream == null) throw new IOException("No output for serialization."); setWriteMode(WRITE); m_objectstream.writeObject(getInstances()); m_objectstream.flush(); m_objectstream.close(); setWriteMode(WAIT); resetWriter(); setWriteMode(CANCEL); }
/** * returns the saver used in the tests * * @return the configured saver */ public AbstractSaver getSaver() { return new SerializedInstancesSaver(); }
/** * Resets the Saver. */ public void resetOptions() { super.resetOptions(); setFileExtension(".bsi"); }
/** * Writes a Batch of instances. * * @throws IOException throws IOException if saving in batch mode is not possible */ public void writeBatch() throws IOException { if(getRetrieval() == INCREMENTAL) throw new IOException("Batch and incremental saving cannot be mixed."); if(getInstances() == null) throw new IOException("No instances to save"); setRetrieval(BATCH); if (m_objectstream == null) throw new IOException("No output for serialization."); setWriteMode(WRITE); m_objectstream.writeObject(getInstances()); m_objectstream.flush(); m_objectstream.close(); setWriteMode(WAIT); resetWriter(); setWriteMode(CANCEL); }
/** * returns the saver used in the tests * * @return the configured saver */ public AbstractSaver getSaver() { return new SerializedInstancesSaver(); }
/** * Resets the Saver. */ public void resetOptions() { super.resetOptions(); setFileExtension(".bsi"); }
/** * Main method. * * @param args should contain the options of a Saver. */ public static void main(String[] args) { runFileSaver(new SerializedInstancesSaver(), args); } }
/** Constructor. */ public SerializedInstancesSaver(){ resetOptions(); }