net.sf.farrago.fennel.calc
Class CalcReg

java.lang.Object
  extended by net.sf.farrago.fennel.calc.CalcReg
All Implemented Interfaces:
CalcProgramBuilder.Operand

public class CalcReg
extends Object
implements CalcProgramBuilder.Operand

Represents a virtual register. Each register lives in a register set of type CalcProgramBuilder.RegisterSetType
Each register is of type CalcProgramBuilder.OpType

Since:
Jan 11, 2004
Version:
$Id: //open/dev/farrago/src/net/sf/farrago/fennel/calc/CalcReg.java#1 $
Author:
jhyde

Field Summary
(package private)  int index
           
(package private)  CalcProgramBuilder.OpType opType
           
(package private)  CalcProgramBuilder.RegisterSetType registerType
           
(package private)  int storageBytes
          Number of bytes storage to allocate for this value.
(package private)  Object value
           
 
Constructor Summary
CalcReg(CalcProgramBuilder.OpType opType, Object value, CalcProgramBuilder.RegisterSetType registerType, int storageBytes, int index)
           
 
Method Summary
(package private)  int getIndex()
           
 CalcProgramBuilder.OpType getOpType()
           
(package private)  CalcProgramBuilder.RegisterSetType getRegisterType()
           
(package private)  Object getValue()
           
 void print(PrintWriter writer)
          Serializes the identity of the register.
(package private)  void printValue(PrintWriter writer, boolean outputComments)
          Serializes the value in the virtual register if not null
NOTE See also print(java.io.PrintWriter) which serializes the "identity" of the register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opType

final CalcProgramBuilder.OpType opType

value

final Object value

registerType

CalcProgramBuilder.RegisterSetType registerType

storageBytes

int storageBytes
Number of bytes storage to allocate for this value.


index

int index
Constructor Detail

CalcReg

CalcReg(CalcProgramBuilder.OpType opType,
        Object value,
        CalcProgramBuilder.RegisterSetType registerType,
        int storageBytes,
        int index)
Method Detail

getOpType

public final CalcProgramBuilder.OpType getOpType()

getRegisterType

final CalcProgramBuilder.RegisterSetType getRegisterType()

getIndex

final int getIndex()

getValue

final Object getValue()

printValue

void printValue(PrintWriter writer,
                boolean outputComments)
Serializes the value in the virtual register if not null
NOTE See also print(java.io.PrintWriter) which serializes the "identity" of the register

Parameters:
writer -
outputComments -

print

public final void print(PrintWriter writer)
Serializes the identity of the register. It does not attempt to serialize its value; see printValue(java.io.PrintWriter, boolean) for that.

Specified by:
print in interface CalcProgramBuilder.Operand
Parameters:
writer -