|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjecthydroScalingAPI.util.database.DataBaseEngine
public class DataBaseEngine
A Memory based implementation of a database engine. This was created to simplify the comunication between GUIs and Analysis Modules with the Gauges and Locations data in CUENCAS. However it is generic enough to handle other types of registers.
| Field Summary | |
|---|---|
static int |
EQUAL_TO
The value used to indicate a EQUAL_TO type of comparison |
static int |
GREATER_THAN
The value used to indicate a GREATER_THAN type of comparison |
static int |
SMALLER_THAN
The value used to indicate a SMALLER_THAN type of comparison |
| Constructor Summary | |
|---|---|
DataBaseEngine()
Creates a new instance of DataBaseEngine |
|
| Method Summary | |
|---|---|
void |
addData(java.lang.String tableName,
java.lang.String RegisterIndex,
DB_Register Field)
Adds an entry to one of the tables |
void |
addData(java.lang.String tableName,
java.lang.String RegisterIndex,
java.lang.Object[] Values)
Adds an entry to one of the tables |
void |
addTable(java.lang.String tableName,
java.lang.String[] Fields,
java.lang.String[] Type)
Adds a DB_Table into the database engine |
DB_Register[] |
compareFieldsTo(java.lang.String tableName,
java.lang.String[] FieldName,
java.lang.Object[] ValueToCompare,
int[] ConditionToCheckFor)
A more general search for registers in a table. |
DB_Register[] |
findRegister(java.lang.String tableName,
java.lang.String[] FieldName,
java.lang.Object[] ValueToMatch)
Finds registers in a table that match a set of values criteria in several of its properties (e.g. |
java.lang.Double |
getMaxValue(java.lang.String tableName,
java.lang.String FieldName)
Returns the maximum value for a given "Numeric" Property in a given table |
java.lang.Double |
getMinValue(java.lang.String tableName,
java.lang.String FieldName)
Returns the minimum value for a given "Numeric" Property in a given table |
DB_Register |
getRegisterByMainIndex(java.lang.String tableName,
java.lang.Object ValueToMatch)
Returns a DB_Register whose main index matches a predetermined keyword in a specific table |
java.util.Vector |
getUniqueValues(java.lang.String tableName,
java.lang.String FieldName)
Returns a vector of Objects with unique values for a given property |
static void |
main(java.lang.String[] args)
An extensive test for the Database engine |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SMALLER_THAN
public static final int EQUAL_TO
public static final int GREATER_THAN
| Constructor Detail |
|---|
public DataBaseEngine()
| Method Detail |
|---|
public void addTable(java.lang.String tableName,
java.lang.String[] Fields,
java.lang.String[] Type)
tableName - The name associated to this tableFields - The properties of the registers in the tableType - The type of register see DB_Table for details
public void addData(java.lang.String tableName,
java.lang.String RegisterIndex,
java.lang.Object[] Values)
tableName - The name associated to this tableRegisterIndex - A unique identifier for the registerValues - The Values to be assigned. Note: Values need to be in the same order than the
Fields variable when the table was created
public void addData(java.lang.String tableName,
java.lang.String RegisterIndex,
DB_Register Field)
tableName - The name associated to this tableField - The DB_Register to addRegisterIndex - A unique identifier for the register
public DB_Register getRegisterByMainIndex(java.lang.String tableName,
java.lang.Object ValueToMatch)
tableName - The name associated to this tableValueToMatch - The keyword to be matched
public DB_Register[] findRegister(java.lang.String tableName,
java.lang.String[] FieldName,
java.lang.Object[] ValueToMatch)
tableName - The name associated to this tableFieldName - The properties to matchValueToMatch - The values to match
public DB_Register[] compareFieldsTo(java.lang.String tableName,
java.lang.String[] FieldName,
java.lang.Object[] ValueToCompare,
int[] ConditionToCheckFor)
0: equal to
-1: smaller than
1: greater than
tableName - The name associated to this tableFieldName - The properties to matchValueToCompare - The values used as referenceConditionToCheckFor - The conditions to apply to the reference value
public java.util.Vector getUniqueValues(java.lang.String tableName,
java.lang.String FieldName)
tableName - The name associated to this tableFieldName - The property to query
public java.lang.Double getMaxValue(java.lang.String tableName,
java.lang.String FieldName)
tableName - The name associated to this tableFieldName - The property to query
public java.lang.Double getMinValue(java.lang.String tableName,
java.lang.String FieldName)
tableName - The name associated to this tableFieldName - The property to query
public static void main(java.lang.String[] args)
args - the command line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.