Namespace EasyXLS
Class ExcelArrayFormula
System.Object
EasyXLS.ExcelArrayFormula
public class ExcelArrayFormula
extends System.Object
This class describes a formula that was array-entered into a range of cells. The range of cells in which the array is entered is defined by the firstRow, lastRow, firstCol, and lastCol fields.
-
Constructor Summary
ConstructorDescriptionDefines an empty instance of the array formulaExcelArrayFormula(int firstRow, int firstCol, int lastRow, int colLast, System.String sFormula)
Defines an instance of the array formulaExcelArrayFormula(System.String range, System.String sFormula)
Defines an instance of the array formula having the specified range and formula restrictions. -
Method Summary
Modifier and TypeMethodDescriptionClone()
Creates and returns a copy of this object.int
Returns the number of columns in the rangeint
Returns the first column in the rangeint
Returns the first row in the rangeSystem.String
Returns the formula of the array.int
Returns the last column in the rangeint
Returns the last row in the rangeint
Returns the number of rows in the rangebool
IsFirstCellInRange(int nRow, int nCol)
Internal use only.void
setFormula(System.String formula)
Sets the formula of the array.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelArrayFormula
public ExcelArrayFormula()Defines an empty instance of the array formula -
ExcelArrayFormula
public ExcelArrayFormula(int firstRow, int firstCol, int lastRow, int colLast, System.String sFormula)Defines an instance of the array formula- Parameters:
firstRow
- the first row of the range where the array formula is enteredfirstCol
- the first column of the range where the array formula is enteredlastRow
- the last row of the range where the array formula is enteredcolLast
- the last column of the range where the array formula is enteredsFormula
- the formula entered as an array; it should start with = (an equal sign) and can be any kind of formula recognized by Excel
-
ExcelArrayFormula
public ExcelArrayFormula(System.String range, System.String sFormula)Defines an instance of the array formula having the specified range and formula restrictions.- Parameters:
range
- the area location of the array formula. It can only be a range of cells (e.g. A1:B2).sFormula
- the formula entered as an array; it should start with = (an equal sign) and can be any kind of formula recognized by Excel
-
-
Method Details
-
getFirstRow
public int getFirstRow()Returns the first row in the range- Returns:
- the first row in the range
-
getLastRow
public int getLastRow()Returns the last row in the range- Returns:
- the last row in the range
-
getFirstColumn
public int getFirstColumn()Returns the first column in the range- Returns:
- the first column in the range
-
getLastColumn
public int getLastColumn()Returns the last column in the range- Returns:
- the last column in the range
-
getRowsNumber
public int getRowsNumber()Returns the number of rows in the range- Returns:
- the last column in the range
-
getColsNumber
public int getColsNumber()Returns the number of columns in the range- Returns:
- the number of columns in the range
-
getFormula
public System.String getFormula()Returns the formula of the array.- Returns:
- the formula of the array
- See Also:
setFormula(System.String)
-
setFormula
public void setFormula(System.String formula)Sets the formula of the array. The formula must start with "=" symbol.- Parameters:
formula
- the array formula- See Also:
getFormula()
-
IsFirstCellInRange
public bool IsFirstCellInRange(int nRow, int nCol)Internal use only. Returns whether or not the cell defined by the specified row and column is the first cell from array formula range- Parameters:
nRow
- the row number of the cellnCol
- the column number of the cell- Returns:
- true if the cell at nRow and nCol is the first cell from array formula range
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-