Documentation of 'org.apache.poi.ss.util.SheetUtil' Java class
SheetUtil
org.apache.poi.ss.util

Class SheetUtil



  • public class SheetUtil
    extends java.lang.Object
    Helper methods for when working with Usermodel sheets
    • Constructor Summary

      Constructors 
      Constructor and Description
      SheetUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static boolean containsCell(CellRangeAddress cr, int rowIx, int colIx) 
      static double getCellWidth(Cell cell, int defaultCharWidth, DataFormatter formatter, boolean useMergedCells)
      Compute width of a single cell
      static Cell getCellWithMerges(Sheet sheet, int rowIx, int colIx)
      Return the cell, taking account of merged regions.
      static double getColumnWidth(Sheet sheet, int column, boolean useMergedCells)
      Compute width of a column and return the result
      static double getColumnWidth(Sheet sheet, int column, boolean useMergedCells, int firstRow, int lastRow)
      Compute width of a column based on a subset of the rows and return the result
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SheetUtil

        public SheetUtil()
    • Method Detail

      • getCellWidth

        public static double getCellWidth(Cell cell,
                                          int defaultCharWidth,
                                          DataFormatter formatter,
                                          boolean useMergedCells)
        Compute width of a single cell
        Parameters:
        cell - the cell whose width is to be calculated
        defaultCharWidth - the width of a single character
        formatter - formatter used to prepare the text to be measured
        useMergedCells - whether to use merged cells
        Returns:
        the width in pixels
      • getColumnWidth

        public static double getColumnWidth(Sheet sheet,
                                            int column,
                                            boolean useMergedCells)
        Compute width of a column and return the result
        Parameters:
        sheet - the sheet to calculate
        column - 0-based index of the column
        useMergedCells - whether to use merged cells
        Returns:
        the width in pixels
      • getColumnWidth

        public static double getColumnWidth(Sheet sheet,
                                            int column,
                                            boolean useMergedCells,
                                            int firstRow,
                                            int lastRow)
        Compute width of a column based on a subset of the rows and return the result
        Parameters:
        sheet - the sheet to calculate
        column - 0-based index of the column
        useMergedCells - whether to use merged cells
        firstRow - 0-based index of the first row to consider (inclusive)
        lastRow - 0-based index of the last row to consider (inclusive)
        Returns:
        the width in pixels
      • containsCell

        public static boolean containsCell(CellRangeAddress cr,
                                           int rowIx,
                                           int colIx)
      • getCellWithMerges

        public static Cell getCellWithMerges(Sheet sheet,
                                             int rowIx,
                                             int colIx)
        Return the cell, taking account of merged regions. Allows you to find the cell who's contents are shown in a given position in the sheet.

        If the cell at the given co-ordinates is a merged cell, this will return the primary (top-left) most cell of the merged region.

        If the cell at the given co-ordinates is not in a merged region, then will return the cell itself.

        If there is no cell defined at the given co-ordinates, will return null.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.