org.apache.poi.hssf.record.formula
Class RefPtgBase

java.lang.Object
  extended by org.apache.poi.hssf.record.formula.Ptg
      extended by org.apache.poi.hssf.record.formula.OperandPtg
          extended by org.apache.poi.hssf.record.formula.RefPtgBase
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
RefNPtg, RefPtg

public abstract class RefPtgBase
extends OperandPtg

ReferencePtgBase - handles references (such as A1, A2, IA4)

Author:
Andrew C. Oliver (acoliver@apache.org), Jason Height (jheight at chariot dot net dot au)

Field Summary
 
Fields inherited from class org.apache.poi.hssf.record.formula.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE
 
Constructor Summary
protected RefPtgBase()
           
protected RefPtgBase(int row, int column, boolean isRowRelative, boolean isColumnRelative)
           
protected RefPtgBase(RecordInputStream in)
           
protected RefPtgBase(java.lang.String cellref)
          Takes in a String representation of a cell reference and fills out the numeric fields.
 
Method Summary
 int getColumn()
           
 int getColumnRawX()
           
 byte getDefaultOperandClass()
           
 int getRow()
          Returns the row number as a short, which will be wrapped (negative) for values between 32769 and 65535
 int getRowAsInt()
          Returns the row number as an int, between 0 and 65535
protected abstract  byte getSid()
           
 int getSize()
           
 boolean isColRelative()
           
 boolean isRowRelative()
           
 void setColRelative(boolean rel)
           
 void setColumn(int col)
           
 void setColumnRawX(int col)
           
 void setRow(int row)
           
 void setRowRelative(boolean rel)
           
 java.lang.String toFormulaString(HSSFWorkbook book)
          return a string representation of this token alone
 java.lang.String toString()
          Overridden toString method to ensure object hash is not printed.
 void writeBytes(byte[] array, int offset)
          write this Ptg to a byte array
 
Methods inherited from class org.apache.poi.hssf.record.formula.OperandPtg
isBaseToken
 
Methods inherited from class org.apache.poi.hssf.record.formula.Ptg
clone, copy, createParsedExpressionTokens, createPtg, getBytes, getEncodedSize, getEncodedSize, getPtgClass, readTokens, serializePtgs, serializePtgStack, setClass, toDebugString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RefPtgBase

protected RefPtgBase()

RefPtgBase

protected RefPtgBase(java.lang.String cellref)
Takes in a String representation of a cell reference and fills out the numeric fields.


RefPtgBase

protected RefPtgBase(int row,
                     int column,
                     boolean isRowRelative,
                     boolean isColumnRelative)

RefPtgBase

protected RefPtgBase(RecordInputStream in)
Method Detail

toString

public final java.lang.String toString()
Description copied from class: Ptg
Overridden toString method to ensure object hash is not printed. This helps get rid of gratuitous diffs when comparing two dumps Subclasses may output more relevant information by overriding this method

Overrides:
toString in class Ptg

writeBytes

public final void writeBytes(byte[] array,
                             int offset)
Description copied from class: Ptg
write this Ptg to a byte array

Specified by:
writeBytes in class Ptg

getSid

protected abstract byte getSid()

setRow

public final void setRow(int row)

getRow

public final int getRow()
Returns the row number as a short, which will be wrapped (negative) for values between 32769 and 65535


getRowAsInt

public final int getRowAsInt()
Returns the row number as an int, between 0 and 65535


isRowRelative

public final boolean isRowRelative()

setRowRelative

public final void setRowRelative(boolean rel)

isColRelative

public final boolean isColRelative()

setColRelative

public final void setColRelative(boolean rel)

setColumnRawX

public final void setColumnRawX(int col)

getColumnRawX

public int getColumnRawX()

setColumn

public final void setColumn(int col)

getColumn

public final int getColumn()

getSize

public final int getSize()
Specified by:
getSize in class Ptg
Returns:
the encoded length of this Ptg, including the initial Ptg type identifier byte.

toFormulaString

public final java.lang.String toFormulaString(HSSFWorkbook book)
Description copied from class: Ptg
return a string representation of this token alone

Specified by:
toFormulaString in class Ptg

getDefaultOperandClass

public final byte getDefaultOperandClass()
Specified by:
getDefaultOperandClass in class Ptg


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.