Class MergeMatrixHelper

  • All Implemented Interfaces:
    Serializable

    public class MergeMatrixHelper
    extends Object
    implements Serializable
    Each sheet has its own MergeMatrixHelper and it manages all merged cells.
    Author:
    Dennis.Chen, jumperchen
    See Also:
    Serialized Form
    • Constructor Detail

      • MergeMatrixHelper

        public MergeMatrixHelper​(List<CellRegion> mergeRange,
                                 int frozenRow,
                                 int frozenCol)
        Parameters:
        mergeRange - List of merge range
        frozenRow -
        frozenCol -
    • Method Detail

      • update

        public void update​(int frozenRow,
                           int frozenCol)
      • isMergeRangeLeftTop

        public boolean isMergeRangeLeftTop​(int row,
                                           int col)
        Check is (row,col) in one of merge range's left-top
      • getMergeRange

        public MergedRect getMergeRange​(int row,
                                        int col)
        Get a merged range which contains cell(row,col)
      • getRanges

        public List<MergedRect> getRanges()
        Get all merged range.
        Returns:
        a list which contains all merged range
      • getMergedRect

        public MergedRect getMergedRect​(int id)
        Returns MergedRect MergedRect by id
        Parameters:
        id -
        Returns:
        MergedRect
      • getRangesByColumn

        public Set getRangesByColumn​(int col)
        Get merged range which contains col
        Parameters:
        col - column index
        Returns:
        a list which contains merged range
      • getRightConnectedColumn

        public int getRightConnectedColumn​(int col,
                                           int top,
                                           int bottom)
      • getLeftConnectedColumn

        public int getLeftConnectedColumn​(int col,
                                          int top,
                                          int bottom)
      • getBottomConnectedRow

        public int getBottomConnectedRow​(int row,
                                         int left,
                                         int right)
      • getTopConnectedRow

        public int getTopConnectedRow​(int row,
                                      int left,
                                      int right)
      • updateMergeRange

        public void updateMergeRange​(int oleft,
                                     int otop,
                                     int oright,
                                     int obottom,
                                     int left,
                                     int top,
                                     int right,
                                     int bottom,
                                     Set toadd,
                                     Set torem)
      • deleteMergeRange

        public void deleteMergeRange​(int left,
                                     int top,
                                     int right,
                                     int bottom,
                                     Set torem)
      • addMergeRange

        public void addMergeRange​(int left,
                                  int top,
                                  int right,
                                  int bottom,
                                  Set toadd,
                                  Set torem)