hydroScalingAPI.mainGUI.objects
Class GaugesManager

java.lang.Object
  extended by hydroScalingAPI.mainGUI.objects.GaugesManager

public class GaugesManager
extends java.lang.Object

This class manages all the information related to Gauges in the database. It runs independent threads that read the information from the Gauge-type files

Author:
Ricardo Mantilla

Constructor Summary
GaugesManager(GUI_InfoManager infoManager, DataBaseEngine dataBase)
          Creates a new instance of GaugesManager
 
Method Summary
 void addData(java.lang.Object[] thisRegister)
          Pushes data into the DataBaseEngine
 MetaGauge[] findGauges(java.util.Vector categories, java.util.Vector values, java.util.Vector conditions)
          Query to the DataBaseEngine for Gauges that meet a specified group of conditions
 java.util.Vector getAgencies()
          Query to the DataBaseEngine for unique Gauge agencies
 java.util.Vector getCodes()
          Query to the DataBaseEngine for unique Gauge codes
 java.util.Vector getCounties()
          Query to the DataBaseEngine for unique Gauge county
 java.lang.Double getEasternmostLat()
          Query to the DataBaseEngine for the easternmost longitude of the gauges in the CUENCAS database
 MetaGauge[] getGauge(java.lang.String code)
          Retereives a group of gauges from the DataBaseEngine.
 MetaGauge getGauge(java.lang.String code, java.lang.String type)
          Retereives a particual Gauge from the DataBaseEngine.
 java.lang.Double getNorthernmostLat()
          Query to the DataBaseEngine for the northernmost latitude of the gauges in the CUENCAS database
 java.lang.Double getSouthernmostLat()
          Query to the DataBaseEngine for the southernmost latitude of the gauges in the CUENCAS database
 java.util.Vector getStates()
          Query to the DataBaseEngine for unique Gauge state
 java.util.Vector getStreams()
          Query to the DataBaseEngine for unique Gauge associated streams
 java.util.Vector getTypes()
          Query to the DataBaseEngine for unique Gauge Types
 java.lang.Double getWesternmostLat()
          Query to the DataBaseEngine for the westernmost longitude of the gauges in the CUENCAS database
 boolean isLoaded()
          Indcates if the GaugesManager has completed loading infomation
static void main(java.lang.String[] args)
          Test for the class
 void threadReport(java.lang.String threadName, java.lang.String status)
          Updates the status of a Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaugesManager

public GaugesManager(GUI_InfoManager infoManager,
                     DataBaseEngine dataBase)
Creates a new instance of GaugesManager

Parameters:
infoManager - The GUI_InfoManager to which the GaugesManager is associated
dataBase - The DataBaseEngine that stores and manages the data
Method Detail

addData

public void addData(java.lang.Object[] thisRegister)
Pushes data into the DataBaseEngine

Parameters:
thisRegister - The register to be added to the database

getGauge

public MetaGauge getGauge(java.lang.String code,
                          java.lang.String type)
Retereives a particual Gauge from the DataBaseEngine. Note that the code and the type uniquely characterize a Gauge.

Parameters:
code - The code of the gauge to retreive
type - The type of the gauge to retreive
Returns:
A MetaGauge

getGauge

public MetaGauge[] getGauge(java.lang.String code)
Retereives a group of gauges from the DataBaseEngine. Note that the several types of Gauge can be associated to a given code.

Parameters:
code - The code of the gauges to retreive
Returns:
A array of MetaGauges

findGauges

public MetaGauge[] findGauges(java.util.Vector categories,
                              java.util.Vector values,
                              java.util.Vector conditions)
Query to the DataBaseEngine for Gauges that meet a specified group of conditions

Parameters:
categories - The categories to use in the search
values - The value assiciated to the category
conditions - The condition to match (e.g. equal to, greater than, smaller than, etc)
Returns:
The group of DB_Register that match the query

getCodes

public java.util.Vector getCodes()
Query to the DataBaseEngine for unique Gauge codes

Returns:
A Vector listing unique codes

getAgencies

public java.util.Vector getAgencies()
Query to the DataBaseEngine for unique Gauge agencies

Returns:
A Vector listing unique agencies

getTypes

public java.util.Vector getTypes()
Query to the DataBaseEngine for unique Gauge Types

Returns:
A Vector listing unique types

getStreams

public java.util.Vector getStreams()
Query to the DataBaseEngine for unique Gauge associated streams

Returns:
A Vector listing unique streams

getCounties

public java.util.Vector getCounties()
Query to the DataBaseEngine for unique Gauge county

Returns:
A Vector listing unique counties

getStates

public java.util.Vector getStates()
Query to the DataBaseEngine for unique Gauge state

Returns:
A Vector listing unique states

getSouthernmostLat

public java.lang.Double getSouthernmostLat()
Query to the DataBaseEngine for the southernmost latitude of the gauges in the CUENCAS database

Returns:
A Double

getNorthernmostLat

public java.lang.Double getNorthernmostLat()
Query to the DataBaseEngine for the northernmost latitude of the gauges in the CUENCAS database

Returns:
A Double

getWesternmostLat

public java.lang.Double getWesternmostLat()
Query to the DataBaseEngine for the westernmost longitude of the gauges in the CUENCAS database

Returns:
A Double

getEasternmostLat

public java.lang.Double getEasternmostLat()
Query to the DataBaseEngine for the easternmost longitude of the gauges in the CUENCAS database

Returns:
A Double

threadReport

public void threadReport(java.lang.String threadName,
                         java.lang.String status)
Updates the status of a Thread. Notice that each Gauge file is read by an independent Thread.

Parameters:
threadName - The Thread name to be checked
status - the

isLoaded

public boolean isLoaded()
Indcates if the GaugesManager has completed loading infomation

Returns:
A boolean indicating the status of the data load process

main

public static void main(java.lang.String[] args)
Test for the class

Parameters:
args - the command line arguments


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.