Class SheetDimension

java.lang.Object
com.inet.excel.parser.SheetDimension

public class SheetDimension extends Object
Immutable container for information about dimension of Excel sheet.
  • Constructor Details

    • SheetDimension

      public SheetDimension(int firstColumnIndex, int lastColumnIndex)
      Creates new immutable container for information about dimension of Excel sheet.
      Parameters:
      firstColumnIndex - index of first column in sheet (inclusive). Minimum value is 1.
      lastColumnIndex - index of last column in sheet (inclusive). Minimum value is 1.
      Throws:
      IllegalArgumentException - if one of specified indexes is smaller than 1; if first index is greater than last index.
  • Method Details

    • parse

      public static SheetDimension parse(String ref)
      Returns instance representing information about dimension of excel sheet retrieved from provided reference.
      Parameters:
      ref - reference to retrieve sheet dimension from.
      Returns:
      instance representing information about dimension of excel sheet or null, in case of invalid reference.
    • getColumnIndexFromCellRef

      public static int getColumnIndexFromCellRef(String cellRef)
      Returns index of column from specified cell reference. In case of invalid cell reference, it will return zero. Examples of valid cell references: "A1", "A7", "G14", "BB44", "ASD1". Examples of invalid cell references: null, "", " ", "5", "$".
      Parameters:
      cellRef - cell reference to retrieve cell index from.
      Returns:
      column index, starting from 1 (inclusive). In case of invalid cell reference, zero.
    • getFirstColumnIndex

      public int getFirstColumnIndex()
      Returns index of first column in sheet (inclusive). Minimum value is 1.
      Returns:
      index of first column in sheet.
    • getLastColumnIndex

      public int getLastColumnIndex()
      Returns index of last column in sheet (inclusive). Minimum value is 1.
      Returns:
      index of last column in sheet.