Package jxl

Class 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 reference
      static java.lang.String getCellReference​(int column, int row)
      Gets the cell reference for the specified column and row
      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
      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
      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
      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
      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
      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
      static java.lang.String getCellReference​(Cell c)
      Gets the cell reference for the cell
      static void getCellReference​(Cell c, java.lang.StringBuffer sb)
      Gets the cell reference for the cell
      static int getColumn​(java.lang.String s)
      Gets the columnn number of the string cell reference
      static java.lang.String getColumnReference​(int c)
      Gets the column letter corresponding to the 0-based column number
      static int getRow​(java.lang.String s)
      Gets the row number of the cell reference
      static java.lang.String getSheet​(java.lang.String ref)
      Gets the sheet name from the cell reference string
      static boolean isColumnRelative​(java.lang.String s)
      Sees if the column component is relative or not
      static boolean isRowRelative​(java.lang.String s)
      Sees if the row component is relative or not
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 column
        row - the row
        buf - 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 number
        colabs - TRUE if the column reference is absolute
        row - the row number
        rowabs - TRUE if the row reference is absolute
        buf - 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 column
        row - 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 index
        column - the column index
        row - the row index
        workbook - the workbook
        buf - 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 sheet
        column - the column
        row - the row
        workbook - the workbook
        buf - 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 sheet
        column - the column
        colabs - TRUE if the column is an absolute reference
        row - the row
        rowabs - TRUE if the row is an absolute reference
        workbook - the workbook
        buf - 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 sheet
        column - the column
        row - the row
        workbook - 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 sheet
        column - the column
        row - the row
        workbook - 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 cell
        sb - string buffer