/** * Thread that writes to a database. * * @author Franck van Breugel */ public class Writer extends Thread { private Database database; /** * Initializes this writer with the given database. * * @param database the database to which to write. */ public Writer(Database database) { super(); this.database = database; } /** * Continuously writing to the database. */ public void run() { while (true) { try { this.database.write(); } catch (InterruptedException e) { e.printStackTrace(); } } } }