hydroScalingAPI.io
Class MetaGauge

java.lang.Object
  extended by hydroScalingAPI.io.MetaGauge
All Implemented Interfaces:
java.lang.Comparable

public class MetaGauge
extends java.lang.Object
implements java.lang.Comparable

Manages the Gauge-type data object

Author:
Ricardo Mantilla

Constructor Summary
MetaGauge(DB_Register register)
          Creates a new instance of MetaGauge
 
Method Summary
 int compareTo(java.lang.Object obj)
          The comparison method
 java.io.File getFileLocation()
          The original Gauge-type file location
 java.lang.String getLabel()
          Returns a string with an identifier code for the Station
 visad.RealTuple getPositionTuple()
          Creates a RealTuple to be plotted in a Display
 java.lang.Object getProperty(java.lang.String key)
          Returns the desired property.
 visad.Tuple getTextTuple()
          Creates a Tuple to be plotted in a Display containing a text label
 double[][] getTimeAndData()
          Returns a 2 by n array where n is the number of data entries for the Gauge.
static void main(java.lang.String[] args)
          Tests for the class
 java.lang.String toString()
          Returns a description of the Gauge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaGauge

public MetaGauge(DB_Register register)
Creates a new instance of MetaGauge

Parameters:
register - Takes in a registry created by the GaugeReader
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Returns the desired property. Available properties are:

[code]

[agency]

[type]

[site name]

[stream name]

[county]

[state]

[data source]

[latitude (deg:min:sec)]

[longitude (deg:min:sec)]

[altitude ASL (m)]

[drainage area (km^2)]

[data units]

[data accuracy]

[file location]

Note: the brackets must be included.

Parameters:
key - The desired property
Returns:
An object that contains the information requested

toString

public java.lang.String toString()
Returns a description of the Gauge.

Overrides:
toString in class java.lang.Object
Returns:
A String describing some gauge properties

compareTo

public int compareTo(java.lang.Object obj)
The comparison method

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - The object to be compared with
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getFileLocation

public java.io.File getFileLocation()
The original Gauge-type file location

Returns:
A File pointing to the Gauge file

getLabel

public java.lang.String getLabel()
Returns a string with an identifier code for the Station

Returns:
A String with the gauge code

getPositionTuple

public visad.RealTuple getPositionTuple()
                                 throws visad.VisADException,
                                        java.rmi.RemoteException
Creates a RealTuple to be plotted in a Display

Returns:
The RealTuple
Throws:
visad.VisADException - Captures errors while creating the RealTuple
java.rmi.RemoteException - Captures errors while creating the RealTuple

getTextTuple

public visad.Tuple getTextTuple()
                         throws visad.VisADException,
                                java.rmi.RemoteException
Creates a Tuple to be plotted in a Display containing a text label

Returns:
The Tuple
Throws:
visad.VisADException - Captures errors while creating the Tuple
java.rmi.RemoteException - Captures errors while creating the Tuple

getTimeAndData

public double[][] getTimeAndData()
                          throws java.io.IOException
Returns a 2 by n array where n is the number of data entries for the Gauge.

Returns:
A double[2][n] with double[0] the dates and double[1] the values
Throws:
java.io.IOException - Captures errors while reading the file to retrive the data

main

public static void main(java.lang.String[] args)
Tests 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.