adams.core
Class ExcelHelper

java.lang.Object
  extended by adams.core.ExcelHelper

public class ExcelHelper
extends Object

Helper class for Excel-related stuff.

Version:
$Revision: 7064 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Constructor Summary
ExcelHelper()
           
 
Method Summary
static int[] getCellLocation(String position)
          Returns row/column index based on the provided position string (e.g., A12).
static String getCellPosition(int row, int col)
          Returns the position of the cell.
static String getColumnPosition(int col)
          Returns the position letter(s) of the column.
static org.apache.poi.ss.usermodel.CellStyle getDateCellStyle(org.apache.poi.ss.usermodel.Workbook wb, String format)
          Creates a cellstyle for a date cell with the specified format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelHelper

public ExcelHelper()
Method Detail

getCellLocation

public static int[] getCellLocation(String position)
                             throws Exception
Returns row/column index based on the provided position string (e.g., A12).

Parameters:
position - the position string to parse
Returns:
the array with row and column index (0-based indices)
Throws:
Exception - in case of an invalid position string

getColumnPosition

public static String getColumnPosition(int col)
Returns the position letter(s) of the column.

Parameters:
col - the column index of the cell (0-based)
Returns:
the position string

getCellPosition

public static String getCellPosition(int row,
                                     int col)
Returns the position of the cell. A position is a combination of a number of letters (for the column) and number (for the row).

Parameters:
row - the row index of the cell (0-based)
col - the column index of the cell (0-based)
Returns:
the position string or null if not found

getDateCellStyle

public static org.apache.poi.ss.usermodel.CellStyle getDateCellStyle(org.apache.poi.ss.usermodel.Workbook wb,
                                                                     String format)
Creates a cellstyle for a date cell with the specified format.

Parameters:
wb - the workbook to use this format for
format - the format to use
Returns:
the generated style


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.