no.ntnu.vegare.visualizer.client.db
Class SQLiteDatabase

java.lang.Object
  extended by no.ntnu.vegare.visualizer.client.db.AbstractLogDatabase
      extended by no.ntnu.vegare.visualizer.client.db.SQLiteDatabase

public class SQLiteDatabase
extends AbstractLogDatabase

A simplified implementation of a SQLite database interface.

Uses SqliteJDBC ( http://www.zentus.com/sqlitejdbc/) to create an in-memory database, and provides an interface to insert or load entries.

The database is cleared when the process dies.

Author:
vegare

Field Summary
static java.lang.Object dbLock
           
 
Constructor Summary
SQLiteDatabase()
          Create an in-memory database and a table for log records.
 
Method Summary
 void addEntries(java.util.Collection<LogEntry> entries)
           
 java.util.ArrayList<LogEntry> getAll()
          Return a list of all incidents in the database
 java.util.ArrayList<LogEntry> query(QueryFilter filter)
           
 
Methods inherited from class no.ntnu.vegare.visualizer.client.db.AbstractLogDatabase
addDatabaseObserver, fireEntriesAdded, removeDatabaseObserver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbLock

public static final java.lang.Object dbLock
Constructor Detail

SQLiteDatabase

public SQLiteDatabase()
Create an in-memory database and a table for log records.

Method Detail

addEntries

public void addEntries(java.util.Collection<LogEntry> entries)
Specified by:
addEntries in class AbstractLogDatabase

getAll

public java.util.ArrayList<LogEntry> getAll()
Return a list of all incidents in the database

Specified by:
getAll in class AbstractLogDatabase

query

public java.util.ArrayList<LogEntry> query(QueryFilter filter)
Specified by:
query in class AbstractLogDatabase