From 6dacb3dfca0a543c0bd337aad255cc7650e3b153 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 7 Aug 2015 08:31:14 +0200 Subject: [PATCH] =?utf8?q?Added=20new=20interface=20for=20managers=20that?= =?utf8?q?=20need=20to=20access=20database,=20maybe=20later=20this=20will?= =?utf8?q?=20be=20changed,=20if=20more=20classes=20need=20same=20methods?= =?utf8?q?=20(remember=20DRY).=20But=20for=20now,=20this=20is=20fine.=20Si?= =?utf8?q?gned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../manager/database/ManageableDatabase.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/org/mxchange/jcore/manager/database/ManageableDatabase.java diff --git a/src/org/mxchange/jcore/manager/database/ManageableDatabase.java b/src/org/mxchange/jcore/manager/database/ManageableDatabase.java new file mode 100644 index 0000000..483b917 --- /dev/null +++ b/src/org/mxchange/jcore/manager/database/ManageableDatabase.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcore.manager.database; + +import org.mxchange.jcore.manager.Manageable; + +/** + * An interface for managers deligating calls to a database frontend + * @author Roland Haeder + */ +public interface ManageableDatabase extends Manageable { + + /** + * Getter for size + * + * @return size of contact "book" + */ + public int size (); + + /** + * Getter for column name at given index. + * + * @param columnIndex Column index + * @return Database column name + */ + public String getColumnName (final int columnIndex); + + /** + * Getter for translated column name at given index. + * + * @param columnIndex Column index + * @return Human-readable column name + */ + public String getTranslatedColumnName (int columnIndex); + + /** + * Somewhat "getter" for value from given row and column index + * + * @param rowIndex Row index + * @param columnIndex Column index + * @return Value from given row/column + */ + public Object getValueFromRowColumn (final int rowIndex, final int columnIndex); + + /** + * Getter for column count + * + * @return Column count + */ + public int getColumnCount (); +} -- 2.39.5