Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class NamedRange

java.lang.Object
  extended by com.aspose.cells.Name
      extended by com.aspose.cells.NamedRange

public class NamedRange
extends Name

Encapsulates the object that represents a named range


Method Summary
 Cell getCell(int rowIndex, int columnIndex)
          Gets Cell object in this range.
 Cell[][] getCells()
          Gets all cells in the range.
 short getEndColumn()
          Gets the column index of the bottom right cell.
 int getEndRow()
          Gets the row index of the bottom right cell.
 Worksheet getSourceSheet()
          Gets the worksheet which contains this range.
 short getStartColumn()
          Gets the column index of the top left cell.
 int getStartRow()
          Gets the row index of the top left cell.
 java.lang.String getText()
          Gets the name of the range.
 void setEndColumn(int endColumn)
          Sets the column index of the bottom right cell.
 void setEndRow(int endRow)
          Sets the row index of the bottom right cell.
 void setOutlineBorder(int borderLineType, Color borderColor)
          Sets outline border for this range.
 void setRefersTo(java.lang.String refersTo)
           
 void setStartColumn(int startColumn)
          Sets the column index of the top left cell.
 void setStartRow(int startRow)
          Sets the row index of the top left cell.
 void setText(java.lang.String text)
          Sets the name of the range.
 
Methods inherited from class com.aspose.cells.Name
getRefersTo, getWorksheet, setInnerText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setOutlineBorder

public void setOutlineBorder(int borderLineType,
                             Color borderColor)
Sets outline border for this range.

Parameters:
borderLineType - line type of border. see BorderLineType
borderColor - color of border

getCell

public Cell getCell(int rowIndex,
                    int columnIndex)
Gets Cell object in this range.

Parameters:
rowIndex - row index in this range, zero based.
columnIndex - column index in this range, zero based.
Returns:
Cell object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

getCells

public Cell[][] getCells()
Gets all cells in the range.

Returns:
An array of cells objects.

setStartRow

public void setStartRow(int startRow)
Sets the row index of the top left cell.

Parameters:
startRow - row index of the top left cell.
Throws:
java.lang.IllegalArgumentException - if row index is out of range.

setStartColumn

public void setStartColumn(int startColumn)
Sets the column index of the top left cell.

Parameters:
startColumn - column index of the top left cell.
Throws:
java.lang.IllegalArgumentException - if column index is out of range.

setEndRow

public void setEndRow(int endRow)
Sets the row index of the bottom right cell.

Parameters:
endRow - row index of the bottom right cell.
Throws:
java.lang.IllegalArgumentException - if row index is out of range.

setEndColumn

public void setEndColumn(int endColumn)
Sets the column index of the bottom right cell.

Parameters:
endColumn - column index of the bottom right cell.
Throws:
java.lang.IllegalArgumentException - if column index is out of range.

getStartRow

public int getStartRow()
Gets the row index of the top left cell.

Returns:
row index of the top left cell.

getStartColumn

public short getStartColumn()
Gets the column index of the top left cell.

Returns:
column index of the top left cell.

getEndRow

public int getEndRow()
Gets the row index of the bottom right cell.

Returns:
row index of the bottom right cell.

getEndColumn

public short getEndColumn()
Gets the column index of the bottom right cell.

Returns:
column index of the bottom right cell.

getText

public java.lang.String getText()
Gets the name of the range.

Overrides:
getText in class Name

setText

public void setText(java.lang.String text)
Sets the name of the range.

Overrides:
setText in class Name
Throws:
java.lang.IllegalArgumentException - if text is invalid.

getSourceSheet

public Worksheet getSourceSheet()
Gets the worksheet which contains this range. Example if Sheet2 contain a named range "dataRange" and the refersTo of named range is "=Sheet1!A1:B1"; This method return Sheet1.

Returns:
the source worksheet.

setRefersTo

public void setRefersTo(java.lang.String refersTo)
Overrides:
setRefersTo in class Name