2 * Copyright (C) 2015 Roland Haeder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.addressbook.database.frontend;
\r
19 import org.mxchange.addressbook.BaseFrameworkSystem;
\r
20 import org.mxchange.addressbook.database.backend.DatabaseBackend;
\r
21 import org.mxchange.addressbook.database.backend.csv.CsvDatabaseBackend;
\r
24 * General database frontend class
\r
26 * @author Roland Haeder
\r
28 public class BaseDatabaseFrontend extends BaseFrameworkSystem {
\r
31 * Instance for database backend
\r
33 private DatabaseBackend backend;
\r
36 * No instances from this class
\r
38 protected BaseDatabaseFrontend () {
\r
42 * Instance for database backend
\r
44 * @return the backend
\r
46 protected DatabaseBackend getBackend () {
\r
47 return this.backend;
\r
51 * Instance for database backend
\r
53 * @param backend the backend to set
\r
55 protected void setBackend (final DatabaseBackend backend) {
\r
56 this.backend = backend;
\r
60 * Initialize backend
\r
62 protected void initBackend () {
\r
64 this.backend = new CsvDatabaseBackend(this.getTableName());
\r