org.prorefactor.core.schema
Class Table

java.lang.Object
  extended by org.prorefactor.core.schema.Table
All Implemented Interfaces:
Xferable

public class Table
extends java.lang.Object
implements Xferable

Table objects are created both by the Schema class and also when temp and work tables are defined within a 4gl compile unit. For temp and work tables, the database is Schema.nullDatabase.


Nested Class Summary
static class Table.Name
          This is a convenience class for working with a string table name, where there may or may not be a database qualifier in the name.
 
Field Summary
static java.util.Comparator<Table> NAME_ORDER
          Comparator for sorting by name.
 
Constructor Summary
Table()
          Only to be used for persistence/serialization.
Table(java.lang.String name)
          Constructor for temporary "comparator" objects.
Table(java.lang.String name, Database database)
          Constructor for schema
Table(java.lang.String name, int storetype)
          Constructor for temp / work tables
 
Method Summary
 Table copyBare(SymbolScopeRoot scope)
          Create a bare minimum copy of a Table definition.
 Database getDatabase()
           
 java.util.ArrayList<Field> getFieldPosOrder()
          Get the ArrayList of fields in field position order (rather than sorted alpha).
 java.util.TreeSet<Field> getFieldSet()
           
 java.lang.String getName()
           
 int getStoretype()
           
 Field lookupField(java.lang.String lookupName)
          Lookup a field by name.
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_ORDER

public static final java.util.Comparator<Table> NAME_ORDER
Comparator for sorting by name.

Constructor Detail

Table

public Table()
Only to be used for persistence/serialization.


Table

public Table(java.lang.String name,
             Database database)
Constructor for schema


Table

public Table(java.lang.String name,
             int storetype)
Constructor for temp / work tables


Table

public Table(java.lang.String name)
Constructor for temporary "comparator" objects.

Method Detail

copyBare

public Table copyBare(SymbolScopeRoot scope)
Create a bare minimum copy of a Table definition. No-op if the table already exists in the requested scope. Copies all of the field definitions as well.

Parameters:
scope - The scope that this table is to be added to.
Returns:
The newly created table, or the existing one from the scope if it has previously been defined.

getDatabase

public Database getDatabase()

getFieldPosOrder

public java.util.ArrayList<Field> getFieldPosOrder()
Get the ArrayList of fields in field position order (rather than sorted alpha).


getFieldSet

public java.util.TreeSet<Field> getFieldSet()

getName

public java.lang.String getName()

getStoretype

public int getStoretype()

lookupField

public Field lookupField(java.lang.String lookupName)
Lookup a field by name. We do not test for uniqueness. We leave that job to the compiler. This function expects an unqualified field name (no name dots).


writeXferBytes

public void writeXferBytes(DataXferStream out)
                    throws java.io.IOException
Implement Xferable.

Specified by:
writeXferBytes in interface Xferable
Throws:
java.io.IOException

writeXferSchema

public void writeXferSchema(DataXferStream out)
                     throws java.io.IOException
Implement Xferable.

Specified by:
writeXferSchema in interface Xferable
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.