org.prorefactor.treeparser
Class Variable

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

public class Variable
extends Symbol
implements Primative, Value

A Symbol defined with DEFINE VARIABLE or any of the other various syntaxes which implicitly define a variable.


Field Summary
 
Fields inherited from interface org.prorefactor.treeparser.SymbolI
NAME_ORDER
 
Constructor Summary
Variable()
          Only to be used for persistence/serialization.
Variable(java.lang.String name, SymbolScope scope)
           
 
Method Summary
 void assignAttributesLike(Primative likePrim)
          Assign datatype, class, extent from another primative (for the LIKE keyword).
 Symbol copyBare(SymbolScope scope)
          Generate a bare-bones copy of this symbol.
 java.lang.String fullName()
          Return the name of the variable.
 java.lang.String getClassName()
          The name of the CLASS that this variable was defined for.
 DataType getDataType()
           
 int getExtent()
           
 int getProgressType()
          Returns TokenTypes.VARIABLE.
 java.lang.Object getValue()
           
 Primative setClassName(java.lang.String s)
           
 Primative setDataType(DataType dataType)
           
 Primative setExtent(int extent)
           
 void setValue(java.lang.Object value)
           
 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, getName, 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

Variable

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


Variable

public Variable(java.lang.String name,
                SymbolScope scope)
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

copyBare

public Symbol copyBare(SymbolScope scope)
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()
Return the name of the variable. For this subclass of Symbol, fullName() returns the same value as getName().

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

getClassName

public java.lang.String getClassName()
Description copied from interface: Primative
The name of the CLASS that this variable was defined for. This is more interesting than getDataType, which returns CLASS. Returns null if this variable was not defined for a CLASS. TODO For 10.1B support, this should return the fully qualified class name, even if the reference wasn't fully qualfied. If that's not to be the case, then John needs to look at method signatures implementation in Callgraph.

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

getDataType

public DataType getDataType()
Specified by:
getDataType in interface Primative

getExtent

public int getExtent()
Specified by:
getExtent in interface Primative

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface Value
See Also:
Value.getValue()

getProgressType

public int getProgressType()
Returns TokenTypes.VARIABLE.

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

setClassName

public Primative setClassName(java.lang.String s)
Specified by:
setClassName in interface Primative

setDataType

public Primative setDataType(DataType dataType)
Specified by:
setDataType in interface Primative

setExtent

public Primative setExtent(int extent)
Specified by:
setExtent in interface Primative

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface Value
See Also:
Value.setValue(java.lang.Object)

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.