org.prorefactor.treeparser
Class TableBuffer

java.lang.Object
  extended by org.prorefactor.treeparser.Symbol
      extended by org.prorefactor.treeparser.TableBuffer
All Implemented Interfaces:
Xferable, SymbolI

public class TableBuffer
extends Symbol

A TableBuffer is a Symbol which provides a link from the syntax tree to a Table object.


Field Summary
 
Fields inherited from interface org.prorefactor.treeparser.SymbolI
NAME_ORDER
 
Constructor Summary
TableBuffer()
          Only to be used for persistence/serialization.
TableBuffer(java.lang.String name, SymbolScope scope, Table table)
          Constructor for a named buffer.
 
Method Summary
 Symbol copyBare(SymbolScope scope)
          For temp/work table, also adds Table definition to the scope if it doesn't already exist.
 java.lang.String fullName()
          Get the "database.buffer" name for schema buffers, get "buffer" for temp/work table buffers.
 FieldBuffer getFieldBuffer(Field field)
          Get or create a FieldBuffer for a Field.
 java.util.Collection<FieldBuffer> getFieldBufferList()
          Get a list of FieldBuffer symbols that have been created for this TableBuffer.
 java.lang.String getName()
          Get the name of the buffer (overrides Symbol.getName).
 int getProgressType()
          Always returns BUFFER, whether this is a named buffer or a default buffer.
 Table getTable()
           
 boolean isDefault()
          Is this the default (unnamed) buffer?
 boolean isDefaultSchema()
          Is this a default (unnamed) buffer for a schema table?
 void setTable(Table table)
           
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class org.prorefactor.treeparser.Symbol
getAllRefsCount, getAsNode, getDefineNode, getIndirectDefineIdNode, getLikeNode, getNumReads, getNumWrites, getScope, isExported, isImported, noteReference, setAsNode, setDefOrIdNode, setLikeNode, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableBuffer

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


TableBuffer

public TableBuffer(java.lang.String name,
                   SymbolScope scope,
                   Table table)
Constructor for a named buffer.

Parameters:
name - Input "" for an unnamed or default buffer
Method Detail

copyBare

public Symbol copyBare(SymbolScope scope)
For temp/work table, also adds Table definition to the scope if it doesn't already exist.

Specified by:
copyBare in class Symbol

fullName

public java.lang.String fullName()
Get the "database.buffer" name for schema buffers, get "buffer" for temp/work table buffers.

Specified by:
fullName in interface SymbolI
Specified by:
fullName in class Symbol

getFieldBufferList

public java.util.Collection<FieldBuffer> getFieldBufferList()
Get a list of FieldBuffer symbols that have been created for this TableBuffer.


getProgressType

public int getProgressType()
Always returns BUFFER, whether this is a named buffer or a default buffer.

Specified by:
getProgressType in interface SymbolI
Specified by:
getProgressType in class Symbol
See Also:
To see if this buffer Symbol is for a schema table, temp-table, or work-table, see Table.getStoreType()., Table.getStoretype().

getFieldBuffer

public FieldBuffer getFieldBuffer(Field field)
Get or create a FieldBuffer for a Field.


getName

public java.lang.String getName()
Get the name of the buffer (overrides Symbol.getName). Returns the name of the table for default (unnamed) buffers.

Specified by:
getName in interface SymbolI
Overrides:
getName in class Symbol

getTable

public Table getTable()

isDefault

public boolean isDefault()
Is this the default (unnamed) buffer?


isDefaultSchema

public boolean isDefaultSchema()
Is this a default (unnamed) buffer for a schema table?


setTable

public void setTable(Table table)

writeXferBytes

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

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

writeXferSchema

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

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


Copyright © 2008 Joanju Software. All Rights Reserved.