View Single Post
  #7 (permalink)  
Old 05-05-2008, 03:54 PM
Jesdisciple Jesdisciple is offline
Member
 
Join Date: May 2008
Posts: 22
Jesdisciple is on a distinguished road
I think you're using classes/interfaces wrongly... A class should describe a type (or singular/static instance) of object, an object an instance of that type, and an interface a type of class. Maybe a Hashtable<String, Hashtable<String, String>> would work like you want...
Code:
//initialize Hashtable<String, Hashtable<String, String>> databaseQuery = new Hashtable<String, Hashtable<String, String>>(); //get a table's statements Hashtable<String, String> statements = databaseQuery.get("tableName"); //get a specific type of statement for the table String statement = statements.get("statementType");

Or you could do:
Code:
public class DatabaseQuery extends Hashtable<String, Hashtable<String, String>> { //implement special get and set methods if you like }

Last edited by Jesdisciple : 05-05-2008 at 04:02 PM.
Reply With Quote