org.prorefactor.treeparser
Class FieldBuffer

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

public class FieldBuffer
extends Symbol
implements Primative

FieldBuffer is the Symbol object linked to from the AST for schema, temp, and work table fields, and FieldBuffer provides the link to the Field object.


Field Summary
 
Fields inherited from interface org.prorefactor.treeparser.SymbolI
NAME_ORDER
 
Constructor Summary
FieldBuffer()
          Only to be used for persistence/serialization.
FieldBuffer(SymbolScope scope, TableBuffer buffer, Field field)
          When you create a FieldBuffer object, you do not set the name, because that comes from the Field object.
 
Method Summary
 void assignAttributesLike(Primative likePrim)
          Assign datatype, class, extent from another primative (for the LIKE keyword).
 boolean canMatch(Field.Name input)
          Could this FieldBuffer be referenced by the input name? Input Field.Name must already be all lowercase.
 Symbol copyBare(SymbolScope scope)
          Deprecated. INVALID. Do not use. There is never any reason to copy a FieldBuffer, since they are created by the tree parser on the fly. They are not defined formally in the syntax.
 java.lang.String fullName()
          Get "database.buffer.field" for schema fields, or "buffer.field" for temp/work table fields.
 TableBuffer getBuffer()
           
 java.lang.String getClassName()
          Gets the underlying Field's className (or null if not a class).
 DataType getDataType()
          Gets the underlying Field's dataType.
 int getExtent()
          The extent comes from the underlying Field.
 Field getField()
           
 java.lang.String getName()
          Returns the Field name.
 int getProgressType()
          Always returns FIELD.
 boolean isExported()
          Is the symbol newly defined here and visible to other compile units? This includes PROTECTED members visible to subclasses.
 boolean isImported()
          Defined as SHARED?
 Primative setClassName(java.lang.String className)
          Sets the underlying Field's className.
 Primative setDataType(DataType dataType)
          Sets the underlying Field's dataType.
 Primative setExtent(int extent)
          Sets the extent of the underlying Field.
 void setName(java.lang.String name)
          Invalid - do not call.
 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, noteReference, setAsNode, setDefOrIdNode, setLikeNode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldBuffer

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


FieldBuffer

public FieldBuffer(SymbolScope scope,
                   TableBuffer buffer,
                   Field field)
When you create a FieldBuffer object, you do not set the name, because that comes from the Field object.

Method Detail

assignAttributesLike

public void assignAttributesLike(Primative likePrim)
Description copied from interface: Primative
Assign datatype, class, extent from another primative (for the LIKE keyword).

Specified by:
assignAttributesLike in interface Primative

canMatch

public boolean canMatch(Field.Name input)
Could this FieldBuffer be referenced by the input name? Input Field.Name must already be all lowercase. Deals with abbreviations, unqualified table/database, and db aliases.


copyBare

public Symbol copyBare(SymbolScope scope)
Deprecated. INVALID. Do not use. There is never any reason to copy a FieldBuffer, since they are created by the tree parser on the fly. They are not defined formally in the syntax.

Description copied from class: Symbol
Generate a bare-bones copy of this symbol. Requires the scope to attach it to as the argument.

Specified by:
copyBare in class Symbol

fullName

public java.lang.String fullName()
Get "database.buffer.field" for schema fields, or "buffer.field" for temp/work table fields.

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

getBuffer

public TableBuffer getBuffer()

getClassName

public java.lang.String getClassName()
Gets the underlying Field's className (or null if not a class).

Specified by:
getClassName in interface Primative
See Also:
Primative.getClassName()

getDataType

public DataType getDataType()
Gets the underlying Field's dataType.

Specified by:
getDataType in interface Primative

getExtent

public int getExtent()
The extent comes from the underlying Field.

Specified by:
getExtent in interface Primative

getField

public Field getField()

getName

public java.lang.String getName()
Returns the Field name. There is no "field buffer name".

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

getProgressType

public int getProgressType()
Always returns FIELD.

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

isExported

public boolean isExported()
Description copied from interface: SymbolI
Is the symbol newly defined here and visible to other compile units? This includes PROTECTED members visible to subclasses.

Specified by:
isExported in interface SymbolI
Overrides:
isExported in class Symbol
See Also:
Symbol.isExported()

isImported

public boolean isImported()
Description copied from interface: SymbolI
Defined as SHARED?

Specified by:
isImported in interface SymbolI
Overrides:
isImported in class Symbol
See Also:
Symbol.isImported()

setClassName

public Primative setClassName(java.lang.String className)
Sets the underlying Field's className.

Specified by:
setClassName in interface Primative

setDataType

public Primative setDataType(DataType dataType)
Sets the underlying Field's dataType.

Specified by:
setDataType in interface Primative

setExtent

public Primative setExtent(int extent)
Sets the extent of the underlying Field.

Specified by:
setExtent in interface Primative

setName

public void setName(java.lang.String name)
Invalid - do not call. Name comes from the Field.

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

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.