hydroScalingAPI.mainGUI.objects
Class LocationsManager

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

public class LocationsManager
extends java.lang.Object

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

Author:
Ricardo Mantilla

Constructor Summary
LocationsManager(GUI_InfoManager infoManager, DataBaseEngine dataBase)
          Creates a new instance of LocationsManager
 
Method Summary
 void addData(java.lang.Object[] thisRegister)
          Pushes data into the DataBaseEngine
 MetaLocation[] findLocations(java.util.Vector categories, java.util.Vector values, java.util.Vector conditions)
          Query to the DataBaseEngine for Locations that meet a specified group of conditions
 java.util.Vector getAgencies()
          Query to the DataBaseEngine for unique Location agencies
 java.util.Vector getCounties()
          Query to the DataBaseEngine for unique Location counties
 java.lang.Double getEasternmostLat()
          Query to the DataBaseEngine for the easternmost longitude of the locations in the CUENCAS database
 MetaLocation[] getLocation(java.lang.String code)
          Retereives a group of locations from the DataBaseEngine.
 MetaLocation getLocation(java.lang.String code, java.lang.String type)
          Retereives a particual Location from the DataBaseEngine.
 java.util.Vector getNames()
          Query to the DataBaseEngine for unique Location names
 java.lang.Double getNorthernmostLat()
          Query to the DataBaseEngine for the northernmost latitude of the locations in the CUENCAS database
 java.lang.Double getSouthernmostLat()
          Query to the DataBaseEngine for the southernmost latitude of the locations in the CUENCAS database
 java.util.Vector getStates()
          Query to the DataBaseEngine for unique Location states
 java.util.Vector getTypes()
          Query to the DataBaseEngine for unique Location types
 java.lang.Double getWesternmostLat()
          Query to the DataBaseEngine for the westernmost longitude of the locations in the CUENCAS database
 boolean isLoaded()
          Indcates if the LocationsManager 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

LocationsManager

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

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

getLocation

public MetaLocation getLocation(java.lang.String code,
                                java.lang.String type)
Retereives a particual Location from the DataBaseEngine. Note that the code and the type uniquely characterize a Location.

Parameters:
code - The code of the location to retreive
type - The type of the location to retreive
Returns:
A MetaLocation

getLocation

public MetaLocation[] getLocation(java.lang.String code)
Retereives a group of locations from the DataBaseEngine. Note that the several types of Location can be associated to a given code.

Parameters:
code - The code of the locations to retreive
Returns:
A array of MetaLocations

findLocations

public MetaLocation[] findLocations(java.util.Vector categories,
                                    java.util.Vector values,
                                    java.util.Vector conditions)
Query to the DataBaseEngine for Locations 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

getNames

public java.util.Vector getNames()
Query to the DataBaseEngine for unique Location names

Returns:
A Vector listing unique names

getAgencies

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

Returns:
A Vector listing unique agencies

getTypes

public java.util.Vector getTypes()
Query to the DataBaseEngine for unique Location types

Returns:
A Vector listing unique types

getCounties

public java.util.Vector getCounties()
Query to the DataBaseEngine for unique Location counties

Returns:
A Vector listing unique counties

getStates

public java.util.Vector getStates()
Query to the DataBaseEngine for unique Location states

Returns:
A Vector listing unique states

getSouthernmostLat

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

Returns:
A Double

getNorthernmostLat

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

Returns:
A Double

getWesternmostLat

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

Returns:
A Double

getEasternmostLat

public java.lang.Double getEasternmostLat()
Query to the DataBaseEngine for the easternmost longitude of the locations 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 Location file is read by an independent Thread.

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

isLoaded

public boolean isLoaded()
Indcates if the LocationsManager 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.