Class SRanges


  • public class SRanges
    extends Object
    A collection of factory methods to create a SRange object.
    Since:
    3.5.0
    Author:
    dennis
    • 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,
                                   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,
                                         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 List<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