public void switchAdapter( final SQLiteDatabase db, final IDBAdapter oldAdapter, final IDBAdapter newAdapter) { final Map<String, BookSettings> bookSettings = oldAdapter.getAllBooks(); oldAdapter.deleteAll(); oldAdapter.onDestroy(db); newAdapter.onCreate(db); newAdapter.restoreBookSettings(bookSettings.values()); }
@Override public Map<String, BookSettings> getSearchNotFound() { return adapter.getSearchNotFound(); }
@Override public boolean deleteBookmarks(final String book, final List<Bookmark> bookmarks) { return adapter.deleteBookmarks(book, bookmarks); }
@Override public boolean updateBookmarks(final BookSettings bs) { return adapter.updateBookmarks(bs); }
@Override public boolean deleteAllBookmarks() { return adapter.deleteAllBookmarks(); }
@Override public boolean deleteAll() { return adapter.deleteAll(); }
@Override public Map<String, BookSettings> getAllBooks() { return adapter.getAllBooks(); }
@Override public void onCreate(final SQLiteDatabase db) { adapter.onCreate(db); }
@Override public boolean clearRecent() { return adapter.clearRecent(); }
@Override public boolean restoreBookSettings(Collection<BookSettings> c) { return adapter.restoreBookSettings(c); }
@Override public boolean storeBookSettings(final List<BookSettings> list) { return adapter.storeBookSettings(list); }
@Override public boolean storeBookSettings(final BookSettings bs) { return bs.persistent && adapter.storeBookSettings(bs); }
@Override public BookSettings getBookSettings(final String fileName) { return adapter.getBookSettings(fileName); }
@Override public Map<String, BookSettings> getRecentBooks(final boolean all) { return adapter.getRecentBooks(all); }
@Override public boolean storeSearch(final String book, final boolean found) { return adapter.storeSearch(book, found); }
@Override public boolean clearSearch() { return adapter.clearSearch(); }
@Override public boolean removeBookFromRecents(final BookSettings bs) { return adapter.removeBookFromRecents(bs); }
@Override public void onDestroy(final SQLiteDatabase db) { adapter.onDestroy(db); }
@Override public void delete(final BookSettings current) { adapter.delete(current); }