com.arctorus.documents.table
Class TableUtil

java.lang.Object
  extended by com.arctorus.documents.table.TableUtil

public class TableUtil
extends java.lang.Object

Helper methods for tables processing.


Constructor Summary
TableUtil()
           
 
Method Summary
static int getColumnIndex(java.lang.String cellName)
          Extracts and returns numerical column index from cell's name.
static int getRowIndex(java.lang.String cellName)
          Extracts and returns numerical row index from cell's name.
static int toIndex(java.lang.String letters)
          Converts letters to numerical zero-based index value, for example column index 'A' to 0, 'G' to 6, 'AB' to 27 and etc.
static java.lang.String toLetters(int index)
          Converts numerical zero-based index value to letters, for example column index 0 to 'A', 6 to 'G', 27 to 'AB' and etc.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableUtil

public TableUtil()
Method Detail

toLetters

public static java.lang.String toLetters(int index)
Converts numerical zero-based index value to letters, for example column index 0 to 'A', 6 to 'G', 27 to 'AB' and etc.

Parameters:
index - zero-based numerical index value.
Returns:
index value converter to letters.

getColumnIndex

public static int getColumnIndex(java.lang.String cellName)
Extracts and returns numerical column index from cell's name.

Parameters:
cellName - cell name to extract column index from.
Returns:
zero-based column index.

getRowIndex

public static int getRowIndex(java.lang.String cellName)
Extracts and returns numerical row index from cell's name.

Parameters:
cellName - cell name to extract row index from.
Returns:
zero-based row index.

toIndex

public static int toIndex(java.lang.String letters)
Converts letters to numerical zero-based index value, for example column index 'A' to 0, 'G' to 6, 'AB' to 27 and etc.

Parameters:
letters - letters to convert.
Returns:
numerical zero-based index value.
Throws:
java.lang.IllegalArgumentException - if letters can't be converted to index.