Class SRanges


  • public class SRanges
    extends java.lang.Object
    A collection of factory methods to create a SRange object.
    Since:
    3.5.0
    Author:
    dennis
    • Constructor Summary

      Constructors 
      Constructor Description
      SRanges()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getNames​(SSheet sheet)
      Returns a list of the defined names belong to SSheet
      static SRange range​(SBook book)
      Returns the associated SRange of the whole specified SSheet.
      static SRange range​(SSheet sheet)
      Returns the associated SRange of the whole specified SSheet.
      static SRange range​(SSheet sheet, int row, int col)
      Returns the associated SRange of the specified SSheet and cell row and column.
      static SRange range​(SSheet sheet, int tRow, int lCol, int bRow, int rCol)
      Returns the associated XRange of the specified XNSheet and area.
      static SRange range​(SSheet sheet, CellRegion region)
      Returns the associated SRange of the specified SSheet and cell-region
      static SRange range​(SSheet sheet, java.lang.String areaReference)
      Returns the associated SRange of the specified SSheet and area reference string (e.g.
      static SRange rangeByName​(SSheet sheet, java.lang.String name)
      Returns the associated SRange of the specified name of a NamedRange (e.g.
      • Methods inherited from class java.lang.Object

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

      • SRanges

        public SRanges()
    • Method Detail

      • range

        public static SRange range​(SSheet sheet)
        Returns the associated SRange of the whole specified SSheet.
        Parameters:
        sheet - the SSheet the Range will refer to.
        Returns:
        the associated SRange of the whole specified SSheet.
      • range

        public static SRange range​(SSheet sheet,
                                   java.lang.String areaReference)
        Returns the associated SRange of the specified SSheet and area reference string (e.g. "A1:D4" or "NSheet2!A1:D4") note that if reference string contains sheet name, the returned range will refer to the named sheet.
        Parameters:
        sheet - the SSheet the Range will refer to.
        reference - the area the Range will refer to (e.g. "A1:D4").
        Returns:
        the associated SRange of the specified SSheet and area reference string (e.g. "A1:D4").
      • range

        public static SRange range​(SSheet sheet,
                                   CellRegion region)
        Returns the associated SRange of the specified SSheet and cell-region
        Parameters:
        sheet - the SSheet the Range will refer to.
        the - cellRegion
        Returns:
        the associated SRange of the specified SSheet and the cell-region
      • rangeByName

        public static SRange rangeByName​(SSheet sheet,
                                         java.lang.String name)
        Returns the associated SRange of the specified name of a NamedRange (e.g. "MyRange");
        Parameters:
        sheet - the SSheet the Range will refer to.
        name - the name of NamedRange (e.g. "MyRange"); .
        Returns:
        the associated SRange of the specified name
      • getNames

        public static java.util.List<java.lang.String> getNames​(SSheet sheet)
        Returns a list of the defined names belong to SSheet
        Parameters:
        sheet - the SSheet the defined name will refer to.
        Returns:
        a list of the defined names of the specified sheet
        Since:
        5.1.0
      • range

        public static SRange range​(SSheet sheet,
                                   int tRow,
                                   int lCol,
                                   int bRow,
                                   int rCol)
        Returns the associated XRange of the specified XNSheet and area.
        Parameters:
        sheet - the SSheet the Range will refer to.
        tRow - top row index of the area the Range will refer to.
        lCol - left column index of the area the Range will refer to.
        bRow - bottom row index of the area the Range will refer to.
        rCol - right column index fo the area the Range will refer to.
        Returns:
        the associated SRange of the specified SSheet and area.
      • range

        public static SRange range​(SSheet sheet,
                                   int row,
                                   int col)
        Returns the associated SRange of the specified SSheet and cell row and column.
        Parameters:
        sheet - the SSheet the Range will refer to.
        row - row index of the cell the Range will refer to.
        col - column index of the cell the Range will refer to.
        Returns:
        the associated SRange of the specified SSheet and cell .
      • range

        public static SRange range​(SBook book)
        Returns the associated SRange of the whole specified SSheet.
        Parameters:
        sheet - the SSheet the Range will refer to.
        Returns:
        the associated SRange of the whole specified SSheet.
        Since:
        3.8.0