From: Roland Haeder Date: Fri, 7 Aug 2015 06:31:14 +0000 (+0200) Subject: Added new interface for managers that need to access database, maybe later this will... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6dacb3dfca0a543c0bd337aad255cc7650e3b153;p=jcore.git Added new interface for managers that need to access database, maybe later this will be changed, if more classes need same methods (remember DRY). But for now, this is fine. Signed-off-by:Roland Häder --- 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 (); +}