Package jxl
Class CellReferenceHelper
- java.lang.Object
-
- jxl.CellReferenceHelper
-
public final class CellReferenceHelper extends java.lang.Object
Exposes some cell reference helper methods to the public interface. This class merely delegates to the internally used reference helper
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
getCellReference(int column, boolean colabs, int row, boolean rowabs, java.lang.StringBuffer buf)
Overloaded method which prepends $ for absolute referencestatic java.lang.String
getCellReference(int column, int row)
Gets the cell reference for the specified column and rowstatic void
getCellReference(int sheet, int column, boolean colabs, int row, boolean rowabs, Workbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etcstatic java.lang.String
getCellReference(int sheet, int column, int row, Workbook workbook)
Gets the fully qualified cell reference given the column, row external sheet reference etcstatic void
getCellReference(int sheet, int column, int row, Workbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etcstatic java.lang.String
getCellReference(int sheet, int column, int row, WritableWorkbook workbook)
Gets the fully qualified cell reference given the column, row external sheet reference etcstatic void
getCellReference(int sheet, int column, int row, WritableWorkbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etcstatic void
getCellReference(int column, int row, java.lang.StringBuffer buf)
Appends the cell reference for the column and row passed in to the string bufferstatic java.lang.String
getCellReference(Cell c)
Gets the cell reference for the cellstatic void
getCellReference(Cell c, java.lang.StringBuffer sb)
Gets the cell reference for the cellstatic int
getColumn(java.lang.String s)
Gets the columnn number of the string cell referencestatic java.lang.String
getColumnReference(int c)
Gets the column letter corresponding to the 0-based column numberstatic int
getRow(java.lang.String s)
Gets the row number of the cell referencestatic java.lang.String
getSheet(java.lang.String ref)
Gets the sheet name from the cell reference stringstatic boolean
isColumnRelative(java.lang.String s)
Sees if the column component is relative or notstatic boolean
isRowRelative(java.lang.String s)
Sees if the row component is relative or not
-
-
-
Method Detail
-
getCellReference
public static void getCellReference(int column, int row, java.lang.StringBuffer buf)
Appends the cell reference for the column and row passed in to the string buffer- Parameters:
column
- the columnrow
- the rowbuf
- the string buffer to append
-
getCellReference
public static void getCellReference(int column, boolean colabs, int row, boolean rowabs, java.lang.StringBuffer buf)
Overloaded method which prepends $ for absolute reference- Parameters:
column
- the column numbercolabs
- TRUE if the column reference is absoluterow
- the row numberrowabs
- TRUE if the row reference is absolutebuf
- the string buffer
-
getCellReference
public static java.lang.String getCellReference(int column, int row)
Gets the cell reference for the specified column and row- Parameters:
column
- the columnrow
- the row- Returns:
- the cell reference
-
getColumn
public static int getColumn(java.lang.String s)
Gets the columnn number of the string cell reference- Parameters:
s
- the string to parse- Returns:
- the column portion of the cell reference
-
getColumnReference
public static java.lang.String getColumnReference(int c)
Gets the column letter corresponding to the 0-based column number- Parameters:
c
- the column number- Returns:
- the letter for that column number
-
getRow
public static int getRow(java.lang.String s)
Gets the row number of the cell reference- Parameters:
s
- the cell reference- Returns:
- the row number
-
isColumnRelative
public static boolean isColumnRelative(java.lang.String s)
Sees if the column component is relative or not- Parameters:
s
- the cell- Returns:
- TRUE if the column is relative, FALSE otherwise
-
isRowRelative
public static boolean isRowRelative(java.lang.String s)
Sees if the row component is relative or not- Parameters:
s
- the cell- Returns:
- TRUE if the row is relative, FALSE otherwise
-
getCellReference
public static void getCellReference(int sheet, int column, int row, Workbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etc- Parameters:
sheet
- the sheet indexcolumn
- the column indexrow
- the row indexworkbook
- the workbookbuf
- a string buffer
-
getCellReference
public static void getCellReference(int sheet, int column, int row, WritableWorkbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etc- Parameters:
sheet
- the sheetcolumn
- the columnrow
- the rowworkbook
- the workbookbuf
- the buffer
-
getCellReference
public static void getCellReference(int sheet, int column, boolean colabs, int row, boolean rowabs, Workbook workbook, java.lang.StringBuffer buf)
Gets the fully qualified cell reference given the column, row external sheet reference etc- Parameters:
sheet
- the sheetcolumn
- the columncolabs
- TRUE if the column is an absolute referencerow
- the rowrowabs
- TRUE if the row is an absolute referenceworkbook
- the workbookbuf
- the string buffer
-
getCellReference
public static java.lang.String getCellReference(int sheet, int column, int row, Workbook workbook)
Gets the fully qualified cell reference given the column, row external sheet reference etc- Parameters:
sheet
- the sheetcolumn
- the columnrow
- the rowworkbook
- the workbook- Returns:
- the cell reference in the form 'Sheet 1'!A1
-
getCellReference
public static java.lang.String getCellReference(int sheet, int column, int row, WritableWorkbook workbook)
Gets the fully qualified cell reference given the column, row external sheet reference etc- Parameters:
sheet
- the sheetcolumn
- the columnrow
- the rowworkbook
- the workbook- Returns:
- the cell reference in the form 'Sheet 1'!A1
-
getSheet
public static java.lang.String getSheet(java.lang.String ref)
Gets the sheet name from the cell reference string- Parameters:
ref
- the cell reference- Returns:
- the sheet name
-
getCellReference
public static java.lang.String getCellReference(Cell c)
Gets the cell reference for the cell- Parameters:
the
- cell
-
getCellReference
public static void getCellReference(Cell c, java.lang.StringBuffer sb)
Gets the cell reference for the cell- Parameters:
c
- the cellsb
- string buffer
-
-