org.apache.poi.hssf.util
Class CellReference

java.lang.Object
  extended by org.apache.poi.hssf.util.CellReference

public final class CellReference
extends java.lang.Object

Author:
Avik Sengupta, Dennis Doubleday (patch to seperateRowColumns())

Constructor Summary
CellReference(int pRow, int pCol, boolean pAbsRow, boolean pAbsCol)
           
CellReference(java.lang.String cellRef)
          Create an cell ref from a string representation.
CellReference(java.lang.String pSheetName, int pRow, int pCol, boolean pAbsRow, boolean pAbsCol)
           
 
Method Summary
protected static java.lang.String convertNumToColString(int col)
          Takes in a 0-based base-10 column and returns a ALPHA-26 representation.
 java.lang.String formatAsString()
          Example return values:
ResultComment A1Cell reference without sheet Sheet1!A1Standard sheet name 'O''Brien''s Sales'!A1' Sheet name with special characters
 short getCol()
           
 int getRow()
           
 java.lang.String getSheetName()
           
 boolean isColAbsolute()
           
 boolean isRowAbsolute()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellReference

public CellReference(java.lang.String cellRef)
Create an cell ref from a string representation. Sheet names containing special characters should be delimited and escaped as per normal syntax rules for formulas.


CellReference

public CellReference(int pRow,
                     int pCol,
                     boolean pAbsRow,
                     boolean pAbsCol)

CellReference

public CellReference(java.lang.String pSheetName,
                     int pRow,
                     int pCol,
                     boolean pAbsRow,
                     boolean pAbsCol)
Method Detail

getRow

public int getRow()

getCol

public short getCol()

isRowAbsolute

public boolean isRowAbsolute()

isColAbsolute

public boolean isColAbsolute()

getSheetName

public java.lang.String getSheetName()
Returns:
possibly null if this is a 2D reference. Special characters are not escaped or delimited

convertNumToColString

protected static java.lang.String convertNumToColString(int col)
Takes in a 0-based base-10 column and returns a ALPHA-26 representation. eg column #3 -> D


formatAsString

public java.lang.String formatAsString()
Example return values:
ResultComment
A1Cell reference without sheet
Sheet1!A1Standard sheet name
'O''Brien''s Sales'!A1' Sheet name with special characters

Returns:
the text representation of this cell reference as it would appear in a formula.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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