![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.cells.Cell
public class Cell
Encapsulates the object that represents a single Workbook cell.
Method Summary | |
---|---|
void |
applyStyle(Style style,
StyleFlag flag)
Applies formattings for a cell. |
void |
clearContent()
Clear the content of the cell. |
int |
compareTo(Cell cellTo)
Compares this Cell with another one for order. |
int |
compareTo(int columnIndexTo)
Compares this Cell with another one that has given column index for order. |
NamedRange[] |
getAssociatedRanges()
Gets all the named ranges which contain this cell. |
Cells |
getCells()
Gets the parent cells of the cell. |
Characters[] |
getCharacters()
Gets the rich text settings of a cell. |
short |
getColumnIndex()
Gets the column index of the cell. |
java.util.Calendar |
getDateTimeValue()
Gets the cell's date time value. |
Cell[] |
getDependents(boolean isAll)
Get all cells which formula depends on this cell. |
java.lang.Double |
getDoubleValue()
Gets the cell's double value. |
java.lang.String |
getFormula()
Gets the formula of the cell. |
CellArea |
getFormulaRange()
Gets the range of array formula or shared formula. |
byte |
getFormulaType()
Gets the formula's type of this cell. |
java.lang.Integer |
getIntValue()
Gets the cell's int value. |
int |
getKey()
Gets the comparable key of this Cell. |
CellArea |
getMergedArea()
Gets the area that this Cell be merged in. |
java.lang.String |
getName()
Gets the name of the cell. |
java.lang.Object[] |
getPrecedents()
Gets all cells or ranges which this cell's formula depends on. |
java.lang.String |
getR1C1Formula()
Gets a R1C1 formula of the Cell. |
int |
getRowIndex()
Gets the row index of the cell. |
java.lang.String |
getStringValue()
Gets the string value contained in the cell. |
Style |
getStyle()
Gets the style of the cell. |
java.lang.Object |
getValue()
Gets the cell's value. |
int |
getValueType()
Gets the cell's value type. |
boolean |
isDateStyle()
Indicates whether this is a date time style. |
boolean |
isFormula()
Gets if the specified cell contains formula. |
boolean |
isMerged()
Checks if a cell is part of a merged range or not. |
boolean |
isPercentStyle()
Indicates whether the number format is percent format. |
void |
removeArrayFormula()
Remove an array formula in a range of cells. |
void |
setAddInFormula(java.lang.String addInFileName,
java.lang.String addInFunction)
|
void |
setArrayFormula(java.lang.String arrayFormula,
int rowNumber,
int columnNumber)
Sets an array formula to a range of cells. |
void |
setCharacters(int startIndex,
int length,
Font font)
Performs rich text formatting. |
void |
setFormula(java.lang.String formula)
Sets the formula of the cell at runtime. |
void |
setKey(int key)
Sets the comparable key of this Cell. |
void |
setR1C1ArrayFormula(java.lang.String arrayFormula,
int rowNumber,
int columnNumber)
Sets a R1C1 array formula to a range of cells. |
void |
setR1C1Formula(java.lang.String r1c1Formula)
Sets a R1C1 formula of the Cell. |
void |
setR1C1SharedFormula(java.lang.String sharedFormula,
int rowNumber,
int columnNumber)
Sets a R1C1 shared formula to a range of cells. |
void |
setSharedFormula(java.lang.String sharedFormula,
int rowNumber,
int columnNumber)
Sets a shared formula to a range of cells. |
void |
setStyle(Style style)
Sets the cell a style. |
void |
setValue(boolean boolValue)
Sets the cell a boolean value. |
void |
setValue(java.util.Calendar dateTimeValue)
Sets the cell a datetime value. |
void |
setValue(double doubleValue)
Sets the cell a double value. |
void |
setValue(int intValue)
Sets the cell an int value. |
void |
setValue(java.lang.Object objectValue)
Sets the cell an object value. |
void |
setValue(java.lang.String stringValue)
Sets the cell a string value. |
void |
setValue(java.lang.String stringValue,
boolean isConverted)
Sets a string value into the cell and converts the value to other data type if appropriate. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getName()
public short getColumnIndex()
public int getRowIndex()
public Cells getCells()
public void clearContent()
CellsException
- if the cell has been removed from the worksheet.public void setValue(int intValue)
intValue
- value to set to the cell.
CellsException
- if the cell has been removed from the worksheet.public void setValue(double doubleValue)
doubleValue
- value to set to the cell.
CellsException
- if the cell has been removed from the worksheet.public void setValue(java.lang.String stringValue)
stringValue
- value to set to the cell.
CellsException
- if the cell has been removed from the worksheet,
or if the length of string value > 32k.public void setValue(java.lang.String stringValue, boolean isConverted)
stringValue
- value to set to the cell.isConverted
- True: converted to other data type if appropriate.public void setValue(boolean boolValue)
boolValue
- value to set to the cell.
CellsException
- if the cell has been removed from the worksheet.public void setValue(java.util.Calendar dateTimeValue)
dateTimeValue
- value to set to the cell.
CellsException
- if the cell has been removed from the worksheet.public void setValue(java.lang.Object objectValue)
value object | cell value type |
---|---|
null | CellValueType.NULL |
java.util.Boolean | CellValueType.BOOLEAN |
java.util.Calendar | CellValueType.DATETIME |
java.util.Date | CellValueType.DATETIME |
java.lang.String | CellValueType.STRING |
java.lang.Integer | CellValueType.INT |
java.lang.Short | CellValueType.INT |
java.lang.Long | CellValueType.INT or CellValueType.DOUBLE |
java.lang.Double | CellValueType.DOUBLE |
java.math.BigDecimal | CellValueType.DOUBLE |
objectValue
- value to set to the cell.
CellsException
- if the cell has bean removed from the worksheet.
java.lang.IllegalArgumentException
- if the cell value type is unkown.public void setCharacters(int startIndex, int length, Font font)
startIndex
- start index.length
- character counts.
If length is negative, all characters after the start index are formatted.
If length is 0, no characters is formatted.font
- font for the specified range. It can be null which means cell's font is used.
CellsException
- if the cell has been removed from the worksheet, or the cell does
not have a string value.public Characters[] getCharacters()
public java.lang.Object getValue()
cell value type | returned value type |
---|---|
CellValueType.NULL | null |
CellValueType.BOOLEAN | Boolean |
CellValueType.DATETIME | Calendar |
CellValueType.STRING | String |
CellValueType.INT | Integer |
CellValueType.DOUBLE | Double |
CellValueType.RICH_TEXT_STRING | String |
CellValueType.ERROR | Error String. |
public java.lang.Double getDoubleValue()
public java.lang.Integer getIntValue()
public java.util.Calendar getDateTimeValue()
public java.lang.String getStringValue()
public int getValueType()
CellValueType
public boolean isPercentStyle()
public boolean isDateStyle()
public Style getStyle()
CellsException
- if the cell has been removed from the worksheet.public void setStyle(Style style)
style
- the style. Use null to clear the cell's style setting.public void applyStyle(Style style, StyleFlag flag)
style
- The style object which will be applied.flag
- Flags which indicates applied formatting properties.public boolean isFormula()
public NamedRange[] getAssociatedRanges()
public java.lang.Object[] getPrecedents()
public Cell[] getDependents(boolean isAll)
isAll
- If False,only finds all cells in this worksheet.
If true ,finds all cells in the workbook.
public boolean isMerged()
getMergedArea()
return null, this method return false; else return true.
getMergedArea()
public CellArea getMergedArea()
public java.lang.String getFormula()
CellsException
- if the cell has been removed from the worksheet.public byte getFormulaType()
FormulaType
public CellArea getFormulaRange()
public void setFormula(java.lang.String formula)
formula
- formula of the cell. Currently supported Workbook built-in functions are listed below:
CellsException
- if the cell has been removed from the worksheet.
java.lang.IllegalArgumentException
- if the formula is not supported or invalid.public java.lang.String getR1C1Formula()
public void setR1C1Formula(java.lang.String r1c1Formula)
r1c1Formula
- a R1C1 formula.setFormula(String)
public void setAddInFormula(java.lang.String addInFileName, java.lang.String addInFunction)
public void setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber)
arrayFormula
- Array formula.rowNumber
- Number of rows to populate result of the array formula.columnNumber
- Number of columns to populate result of the array formula.public void setR1C1ArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber)
arrayFormula
- Array formula.rowNumber
- Number of rows to populate result of the array formula.columnNumber
- Number of columns to populate result of the array formula.public void setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber)
sharedFormula
- shared formula.rowNumber
- Number of rows to populate result of the array formula.columnNumber
- Number of columns to populate result of the array formula.public void setR1C1SharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber)
sharedFormula
- shared formula.rowNumber
- Number of rows to populate result of the array formula.columnNumber
- Number of columns to populate result of the array formula.public void removeArrayFormula()
public int compareTo(int columnIndexTo)
columnIndexTo
- the column index to be compared with the column index of this Cell.
public int compareTo(Cell cellTo)
cellTo
- the Cell to be compared with this one.
public int getKey()
getColumnIndex()
.
public void setKey(int key)
key
- key value.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |