ucar.nc2.iosp.gempak
Class GempakParameterTable

java.lang.Object
  extended by ucar.nc2.iosp.gempak.GempakParameterTable

public class GempakParameterTable
extends java.lang.Object

Class to hold a lookup of gempak parameters

Version:
$Revision: 1.3 $
Author:
IDV Development Team

Constructor Summary
GempakParameterTable()
          Create a new table.
 
Method Summary
static void addParameters(java.lang.String tbl)
          Add parameters from the table
static java.io.InputStream getInputStream(java.lang.String resourceName)
          Get the input stream to the given resource
static GempakGridParameter getParameter(java.lang.String name)
          Get the parameter for the given name
static void main(java.lang.String[] args)
          Test
static byte[] readBytes(java.io.InputStream is)
          Read the bytes in the given input stream.
static java.lang.String readContents(java.io.InputStream is)
          Read in the bytes from the given InputStream and construct and return a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GempakParameterTable

public GempakParameterTable()
Create a new table.

Method Detail

addParameters

public static void addParameters(java.lang.String tbl)
                          throws java.io.IOException
Add parameters from the table

Parameters:
tbl - table location
Throws:
java.io.IOException - problem reading table.

getParameter

public static GempakGridParameter getParameter(java.lang.String name)
Get the parameter for the given name

Parameters:
name - name of the parameter (eg:, TMPK);
Returns:
corresponding parameter or null if not found in table

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Test

Parameters:
args - ignored
Throws:
java.io.IOException - problem reading the table.

readContents

public static java.lang.String readContents(java.io.InputStream is)
                                     throws java.io.IOException
Read in the bytes from the given InputStream and construct and return a String. Closes the InputStream argument.

Parameters:
is - InputStream to read from
Returns:
contents as a String
Throws:
java.io.IOException - problem reading contents

readBytes

public static byte[] readBytes(java.io.InputStream is)
                        throws java.io.IOException
Read the bytes in the given input stream.

Parameters:
is - The input stream
Returns:
The bytes
Throws:
java.io.IOException - On badness

getInputStream

public static java.io.InputStream getInputStream(java.lang.String resourceName)
Get the input stream to the given resource

Parameters:
resourceName - The resource name. May be a file, url, java resource, etc.
Returns:
The input stream to the resource