com.aspose.cells

Class UnionRange

  • java.lang.Object
    • com.aspose.cells.UnionRange
public class UnionRange 
extends java.lang.Object

Represents union range.

Property Getters/Setters Summary
intgetCellCount()
Gets all cell count in the range.
intgetColumnCount()
Gets the count of rows in the range.
intgetFirstColumn()
Gets the index of the first column of the range.
intgetFirstRow()
Gets the index of the first row of the range.
booleanhasRange()
Indicates whether this has range.
com.aspose.cells.Hyperlink[]getHyperlinks()
Gets all hyperlink in the range.
java.lang.StringgetName()
void
setName(java.lang.Stringvalue)
           Gets or sets the name of the range.
intgetRangeCount()
Gets the count of the ranges.
com.aspose.cells.Range[]getRanges()
Gets all union ranges.
java.lang.StringgetRefersTo()
Gets the range's refers to.
intgetRowCount()
Gets the count of rows in the range.
java.lang.ObjectgetValue()
void
setValue(java.lang.Objectvalue)
           Gets and sets the values of the range.
 
Method Summary
voidapplyStyle(Style style, StyleFlag flag)
Applies formats for a whole range.
voidcopy(UnionRange range, PasteOptions options)
Copying the range with paste special options.
UnionRangeintersect(com.aspose.cells.Range[] ranges)
Intersects another reange.
UnionRangeintersect(UnionRange unionRange)
Intersects another reange.
UnionRangeintersect(java.lang.String range)
Intersects another reange.
java.util.Iteratoriterator()
Gets the enumerator for cells in this Range.
voidmerge()
Combines a range of cells into a single cell.
voidputValue(java.lang.String stringValue, boolean isConverted, boolean setStyle)
Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset.
voidsetOutlineBorders(int borderStyle, com.aspose.cells.Color borderColor)
Sets the outline borders around a range of cells with same border style and color.
voidsetOutlineBorders(int[] borderStyles, com.aspose.cells.Color[] borderColors)
Sets out line borders around a range of cells.
voidsetStyle(Style style)
Sets the style of the range.
UnionRangeunion(com.aspose.cells.Range[] ranges)
Union the ranges.
UnionRangeunion(UnionRange unionRange)
Union another range.
UnionRangeunion(java.lang.String range)
Union another range.
voidunMerge()
Unmerges merged cells of this range.
 

    • Property Getters/Setters Detail

      • getFirstRow

        public int getFirstRow()
        
        Gets the index of the first row of the range. Only effects when it only contains one range.
      • getFirstColumn

        public int getFirstColumn()
        
        Gets the index of the first column of the range. Only effects when it only contains one range.
      • getRowCount

        public int getRowCount()
        
        Gets the count of rows in the range. Only effects when it only contains one range.
      • getColumnCount

        public int getColumnCount()
        
        Gets the count of rows in the range. Only effects when it only contains one range.
      • getValue/setValue

        public java.lang.Object getValue() / public void setValue(java.lang.Object value)
        
        Gets and sets the values of the range.
      • getName/setName

        public java.lang.String getName() / public void setName(java.lang.String value)
        
        Gets or sets the name of the range. Named range is supported. For example,

        range.Name = "Sheet1!MyRange";

      • getRefersTo

        public java.lang.String getRefersTo()
        
        Gets the range's refers to.
      • hasRange

        public boolean hasRange()
        
        Indicates whether this has range.
      • getHyperlinks

        public com.aspose.cells.Hyperlink[] getHyperlinks()
        
        Gets all hyperlink in the range.
      • getCellCount

        public int getCellCount()
        
        Gets all cell count in the range.
      • getRangeCount

        public int getRangeCount()
        
        Gets the count of the ranges.
      • getRanges

        public com.aspose.cells.Range[] getRanges()
        
        Gets all union ranges.

    setValue

    public voidsetValue(java.lang.Objectvalue)
    
    Gets and sets the values of the range.

    setName

    public voidsetName(java.lang.Stringvalue)
    
    Gets or sets the name of the range. Named range is supported. For example,

    range.Name = "Sheet1!MyRange";

    • Method Detail

      • merge

        public void merge()
        Combines a range of cells into a single cell. Reference the merged cell via the address of the upper-left cell in the range.
      • unMerge

        public void unMerge()
        Unmerges merged cells of this range.
      • putValue

        public void putValue(java.lang.String stringValue, boolean isConverted, boolean setStyle)
        Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset.
        Parameters:
        stringValue - Input value
        isConverted - True: converted to other data type if appropriate.
        setStyle - True: set the number format to cell's style when converting to other data type
      • setStyle

        public void setStyle(Style style)
        Sets the style of the range.
        Parameters:
        style - The Style object.
      • applyStyle

        public void applyStyle(Style style, StyleFlag flag)
        Applies formats for a whole range. Each cell in this range will contains a Style object. So this is a memory-consuming method. Please use it carefully.
        Parameters:
        style - The style object which will be applied.
        flag - Flags which indicates applied formatting properties.
      • copy

        public void copy(UnionRange range, PasteOptions options)
                 throws java.lang.Exception
        Copying the range with paste special options.
        Parameters:
        range - The soure range.
        options - The paste special options.
      • iterator

        public java.util.Iterator iterator()
        Gets the enumerator for cells in this Range. When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).
        Returns:
        The cells enumerator
      • setOutlineBorders

        public void setOutlineBorders(int[] borderStyles, com.aspose.cells.Color[] borderColors)
        Sets out line borders around a range of cells. Both the length of borderStyles and borderStyles must be 4. The order of of borderStyles and borderStyles must be top,bottom,left,right
        Parameters:
        borderStyles - Border styles.
        borderColors - Border colors.
      • setOutlineBorders

        public void setOutlineBorders(int borderStyle, com.aspose.cells.Color borderColor)
        Sets the outline borders around a range of cells with same border style and color.
        Parameters:
        borderStyle - A CellBorderType value. Border style.
        borderColor - Border color.
      • intersect

        public UnionRange intersect(java.lang.String range)
        Intersects another reange. If the two union ranges are not intersected, returns null.
        Parameters:
        range - The range.
      • intersect

        public UnionRange intersect(UnionRange unionRange)
        Intersects another reange. If the two union ranges are not intersected, returns null.
        Parameters:
        unionRange - The range.
      • intersect

        public UnionRange intersect(com.aspose.cells.Range[] ranges)
        Intersects another reange. If the two union ranges are not intersected, returns null.
        Parameters:
        ranges - The range.
      • union

        public UnionRange union(java.lang.String range)
        Union another range.
        Parameters:
        range - The range.
        Returns:
      • union

        public UnionRange union(UnionRange unionRange)
        Union another range.
        Parameters:
        unionRange - The range.
        Returns:
      • union

        public UnionRange union(com.aspose.cells.Range[] ranges)
        Union the ranges.
        Parameters:
        ranges - The ranges.
        Returns: