public class Cell extends java.lang.Object implements IInplaceEditable
Worksheet.| Modifier and Type | Method and Description |
|---|---|
boolean |
clear()
Clears the contents of this cell.
|
boolean |
equals(java.lang.Object obj) |
Annotation |
getAnnotation()
Gets the
Annotation object that represents a comment for this cell. |
CellStorage |
getCellStorage()
Gets the underlying cell storage, possibly
null, if this object represents a default cell. |
int |
getColumn()
Gets the zero-based index of the column of the represented cell.
|
IConditionalFormatCollection |
getConditionalFormats()
Gets a list with format objects that can be used to customize
the appearance of the cell based on various conditions.
|
java.lang.Object |
getData()
Gets or sets the cell data.
|
java.lang.String |
getDisplayValue() |
Hyperlink |
getHyperlink()
Gets a
Hyperlink object that represents the hyperlink associated with this cell. |
java.util.Locale |
getLocale()
Gets the locale used to format the value of this cell.
|
java.lang.Object |
getRawData()
Gets the raw data of the cell.
|
java.lang.Object |
getRawValue()
Gets the raw value of the cell.
|
int |
getRow()
Gets the zero-based index of the row of the represented cell.
|
IStyle |
getStyle()
Gets an
IStyle object that can be used to customize the appearance of the cell. |
java.lang.String |
getTextToEdit()
Returns the text of the object which should be displayed initially when the object is in-place edited.
|
IValidation |
getValidation()
Gets an
IValidation object that can be used to specify validation rules for the data in the cell. |
java.lang.Object |
getValue()
Gets the effective value of this cell.
|
Worksheet |
getWorksheet()
Gets the worksheet this cell belongs to.
|
int |
hashCode() |
boolean |
isEditable()
Gets a value indicating whether this cell is editable.
|
boolean |
isHidden()
Gets a value indicating whether this cell belongs to a hidden column or row.
|
boolean |
isMerged()
Gets a value indicating whether this cell is part of a merged cell.
|
void |
removeAnnotation()
Removes an annotation object from the cell.
|
void |
removeHyperlink()
Removes the hyperlink associated with this cell.
|
void |
reset()
Clears the cell contents, as well as its associated style,
hyperlink, annotation, conditional formatting and data validations.
|
void |
setAnnotation(java.lang.String value)
Sets the text of the annotation object, associated with this cell.
|
void |
setData(java.lang.Object value)
Sets the cell data.
|
void |
setData(java.lang.Object value,
int dcolumn,
int drow)
Sets the data of the cell, represented by this object.
|
void |
setData(java.lang.Object value,
int dcolumn,
int drow,
boolean isCultureInvariant)
Sets the data of the cell, represented by this object.
|
void |
setEditable(boolean value)
Sets a value indicating whether this cell is editable.
|
void |
setEditedText(java.lang.String newText)
Sets the edited text to the object after the in-place editing operation has been completed successfully.
|
void |
setHyperlink(Hyperlink value)
Sets a
Hyperlink object that represents the hyperlink associated with this cell. |
void |
setHyperlink(HyperlinkType type,
java.lang.String target,
java.lang.String subTarget)
Sets a hyperlink, associated with this cell.
|
void |
setHyperlinkInternal(HyperlinkType type,
java.lang.String target,
java.lang.String subTarget,
java.lang.String toolTip)
Sets an implicit hyperlink associated with this cell.
|
void |
setLocale(java.util.Locale value)
Sets the locale used to format the value of this cell.
|
java.lang.String |
toString() |
<T> T |
valueAs(java.lang.Class<T> type)
Down-casts the cell value to specified type.
|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getTextToEdit()
IInplaceEditablegetTextToEdit in interface IInplaceEditablepublic void setEditedText(java.lang.String newText)
IInplaceEditablesetEditedText in interface IInplaceEditablenewText - The new text of the in-place edited object.public java.lang.String toString()
toString in class java.lang.Objectpublic void setData(java.lang.Object value,
int dcolumn,
int drow)
If value is a string, starting with an equal sign (=), it is interpreted as a formula. To specify a string, starting with an equal sign as cell data, prefix the string with a single apostrophe ('). The parameters dcolumn and drow can be used to offset all relative cell references in the formula. For example, the following call setData("=A1", 1, 2) will actually set the formula "=B3" as data in the cell.
value - The new data of the cell.dcolumn - If value represents a formula, this is the column offset
of all relative cell references. Otherwise, this value is ignored.drow - If value represents a formula, this is the row offset of
all relative cell references. Otherwise, this value is ignored.public void setData(java.lang.Object value,
int dcolumn,
int drow,
boolean isCultureInvariant)
If value is a string, starting with an equal sign (=), it is interpreted as a formula. To specify a string, starting with an equal sign as cell data, prefix the string with a single apostrophe '''. The parameters dcolumn and drow can be used to offset all relative cell references in the formula. For example, the following call SetData("=A1", 1, 2) will actually set the formula "=B3" as data in the cell.
value - The new data of the cell.dcolumn - If value represents a formula, this is the column offset of
all relative cell references. Otherwise, this value is ignored.drow - If value represents a formula, this is the row offset of
all relative cell references. Otherwise, this value is ignored.isCultureInvariant - true to interpret the specified data as a culture-invariant;
false to interpret it in the context of the worksheet's locale.public boolean clear()
true if the cell contained actual data before the call;
false, if the cell is already blank.
public void reset()
public void setAnnotation(java.lang.String value)
value - The text of the comment.public void removeAnnotation()
public void setHyperlink(HyperlinkType type, java.lang.String target, java.lang.String subTarget)
type - The type of the hyperlink.target - The hyperlink target.subTarget - The hyperlink sub-target.public void setHyperlinkInternal(HyperlinkType type, java.lang.String target, java.lang.String subTarget, java.lang.String toolTip)
Used internally by the expression evaluation engine.
type - The type of the hyperlink.target - The hyperlink target.subTarget - The hyperlink sub-target.toolTip - The hyperlink tooltip.public void removeHyperlink()
public java.lang.String getDisplayValue()
public Worksheet getWorksheet()
public CellStorage getCellStorage()
null, if this object represents a default cell.public java.lang.Object getData()
If this property is set to null, this is equivalent to clearing the cell via clear().
If the specified value is a string, starting with an equal sign (=), it is interpreted as a formula.
To specify a string, starting with an equal sign as cell data, prefix the string with a single apostrophe (').
public void setData(java.lang.Object value)
If this property is set to null, this is equivalent to clearing the cell via clear().
If the specified value is a string, starting with an equal sign (=), it is interpreted as a formula.
To specify a string, starting with an equal sign as cell data, prefix the string with a single apostrophe (').
public java.lang.Object getRawData()
public java.lang.Object getValue()
public java.lang.Object getRawValue()
public <T> T valueAs(java.lang.Class<T> type)
type - A Class instance specifying the target type.public Annotation getAnnotation()
Annotation object that represents a comment for this cell.public Hyperlink getHyperlink()
Hyperlink object that represents the hyperlink associated with this cell.public void setHyperlink(Hyperlink value)
Hyperlink object that represents the hyperlink associated with this cell.public IStyle getStyle()
IStyle object that can be used to customize the appearance of the cell.public IValidation getValidation()
IValidation object that can be used to specify validation rules for the data in the cell.public IConditionalFormatCollection getConditionalFormats()
public int getColumn()
public int getRow()
public boolean isMerged()
public boolean isHidden()
public java.util.Locale getLocale()
public void setLocale(java.util.Locale value)
public void setEditable(boolean value)
If value is true the content of cell can be edited.
If value is false the input of new content or change
of already existing one is blocked. The formula bar input or change
for this cell is also blocked.
public boolean isEditable()