edu.iris.dmc.pdcc.util
Class SchemaReader

java.lang.Object
  extended byedu.iris.dmc.pdcc.util.SchemaReader

public class SchemaReader
extends java.lang.Object

This class reads the PDCC schema file and provides table name and field definitions.

Version:
1/21/2003
Author:
Robert Casey, IRIS DMC

Constructor Summary
SchemaReader(java.lang.String schemaFile)
          instantiate SchemaReader by reading indicated filename.
 
Method Summary
 void close()
          Close currently open schema file.
 java.util.Vector getFieldFlags()
          Return a vector of the field flags
 java.util.Vector getFieldNames()
          Return the vector of field names...may be null.
 java.util.Vector getFieldTypes()
          Return the vector of field types...may be null
 java.lang.String getNextTable()
          Extract the next table definition from the buffered reader.
 int getNumFields()
          Return the number of fields in the current table, or 0
 java.lang.String getTableName()
          return the current table name or null string.
static void main(java.lang.String[] args)
          Test the reader by displaying the contents of provided schema file name.
 void open(java.lang.String schemaFile)
          Open the schema file for reading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaReader

public SchemaReader(java.lang.String schemaFile)
             throws java.lang.Exception
instantiate SchemaReader by reading indicated filename.

Method Detail

open

public void open(java.lang.String schemaFile)
          throws java.lang.Exception
Open the schema file for reading. bufReader is the handle we will read from.

Throws:
java.lang.Exception

getNextTable

public java.lang.String getNextTable()
                              throws java.lang.Exception
Extract the next table definition from the buffered reader. return the name of the table on success. return a null if no more tables can be read

Throws:
java.lang.Exception

getTableName

public java.lang.String getTableName()
return the current table name or null string.


getNumFields

public int getNumFields()
Return the number of fields in the current table, or 0


getFieldNames

public java.util.Vector getFieldNames()
Return the vector of field names...may be null.


getFieldTypes

public java.util.Vector getFieldTypes()
Return the vector of field types...may be null


getFieldFlags

public java.util.Vector getFieldFlags()
Return a vector of the field flags


close

public void close()
           throws java.io.IOException
Close currently open schema file. no more reads can be performed from that file.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Test the reader by displaying the contents of provided schema file name. args[0] = filepath to schema file



brought to you by Incorporated Research Institutions for Seismology
June 29 2006