its.SQL
Class Contents

java.lang.Object
  extended byits.SQL.Contents

public class Contents
extends java.lang.Object

Provides an object-oriented view of the SDD Contents frame. Created and used by the SDD Parser to store information about the SDD Contents frame.


Constructor Summary
Contents(Schema schema, java.lang.String contents)
          Creates a Contents object from the given definition.
Contents(java.lang.String strContents)
          Used by the SDD Contents parser to construct an empty Contents object.
 
Method Summary
 void addTable(java.lang.String name, java.util.Vector columns, int dataBegin, int dataEnd)
          Used by the SDD Contents parser as it parses the buffer.
 java.lang.String getString()
           
 int getTableCount()
           
 boolean hasTable(java.lang.String name)
           
 ContentsData readTable(java.lang.String name)
          Given the name of a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.
 ContentsData readTable(java.lang.String name, boolean preserveQuotes)
          Given the name of a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.
 ContentsData readTable(Table table)
          Given a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.
 java.util.Enumeration tables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Contents

public Contents(java.lang.String strContents)
Used by the SDD Contents parser to construct an empty Contents object. The object needs to hold a reference to the buffer being parsed because readTable grabs the data from the buffer on demand.


Contents

public Contents(Schema schema,
                java.lang.String contents)
         throws ContentsParserException,
                java.lang.Exception
Creates a Contents object from the given definition. Invokes the SDD Contents parser to ensure that the given string contains rows of data appropriate for tables in the given Schema.

Throws:
ContentsParserException - if the given definition is incorrect
java.lang.Exception
Method Detail

getString

public java.lang.String getString()
Returns:
the text of the SDD Contents frame used to create this object.

addTable

public void addTable(java.lang.String name,
                     java.util.Vector columns,
                     int dataBegin,
                     int dataEnd)
Used by the SDD Contents parser as it parses the buffer.


tables

public java.util.Enumeration tables()
Returns:
the list of table names specified in the SDD Contents.

getTableCount

public int getTableCount()
Returns:
the number of tables contained in this Contents frame

hasTable

public boolean hasTable(java.lang.String name)
Returns:
true if there is data for the given table in this contents object

readTable

public ContentsData readTable(java.lang.String name)
Given the name of a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.

Returns:
the dataset for the table with the given name

readTable

public ContentsData readTable(java.lang.String name,
                              boolean preserveQuotes)
Given the name of a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.

Parameters:
preserveQuotes - if true, the single quotes that surround SQL delimited identifiers will not be removed. The historical behavior of this method is to remove them.
Returns:
the dataset for the table with the given name

readTable

public ContentsData readTable(Table table)
Given a table from the SDD Schema, returns rows of data destined for that table, in ContentsData format.

Returns:
the dataset for the table with the given name