Package com.independentsoft.office.odf
Class Cell
java.lang.Object
com.independentsoft.office.odf.Cell
- All Implemented Interfaces:
IContentElement
- Direct Known Subclasses:
CoveredCell
Represents a table cell. It is contained in a table row element. A table cell can contain paragraphs and other text content as well as sub tables. Table cells may span multiple columns and rows. Table cells may be empty.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<ICellContent>protected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected intprotected intprotected intprotected Stringprotected Stringprotected Stringprotected Stringprotected CellValueType -
Constructor Summary
ConstructorsConstructorDescriptionCell()Initializes a new instance of the Cell class.Cell(boolean value)Initializes a new instance of the Cell class.Cell(double value)Initializes a new instance of the Cell class.Initializes a new instance of the Cell class.Cell(String value, CellValueType type)Initializes a new instance of the Cell class.Initializes a new instance of the Cell class. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.Gets the content.Returns all content elements.Specifies if a cell contains a validity check.Gets the currency for a value of a table cell, a text field, or a form property.Gets the formula for a table cell.intGets the number of columns spanned by a matrix.intGets the number of rows spanned by a matrix.intGets the number of successive columns in which a cell is repeated.Returns the parent content element.intGets the number of columns that a cell spans.intGets the number of rows that a cell spans.getStyle()Gets the style of table cell.getType()Gets the value-type of a table cell, a text field, or a form property.getValue()Gets the currency, float or percentage value for a table cell, a text field, or a form property.voidsetContentValidation(String contentValidation)Specifies if a cell contains a validity check.voidsetCurrency(String currency)Sets the currency for a value of a table cell, a text field, or a form property.voidsetFormula(String formula)Sets the formula for a table cell.voidsetMatrixColumnsSpannedCount(int matrixColumnsSpannedCount)Sets the number of columns spanned by a matrix.voidsetMatrixRowsSpannedCount(int matrixRowsSpannedCount)Sets the number of rows spanned by a matrix.voidsetNumberOfRepeatedCells(int numberOfRepeatedCells)Sets the number of successive columns in which a cell is repeated.voidsetParent(IContentElement parent)Sets the parent content element.voidsetSpannedColumnsCount(int spannedColumnsCount)Sets the number of columns that a cell spans.voidsetSpannedRowsCount(int spannedRowsCount)Sets the number of rows that a cell spans.voidSets the style of table cell.voidsetType(CellValueType type)Sets the value-type of a table cell, a text field, or a form property.voidSets the currency, float or percentage value for a table cell, a text field, or a form property.toString()Converts the value of the current Cell object to its equivalent string representation.
-
Field Details
-
-
numberOfRepeatedCells
protected int numberOfRepeatedCells -
style
-
contentValidation
-
isProtected
protected boolean isProtected -
numericValue
-
dateValue
-
timeValue
-
booleanValue
-
stringValue
-
type
-
formula
-
matrixColumnsSpannedCount
protected int matrixColumnsSpannedCount -
matrixRowsSpannedCount
protected int matrixRowsSpannedCount -
currency
-
-
Constructor Details
-
Cell
public Cell()Initializes a new instance of the Cell class. -
Cell
Initializes a new instance of the Cell class.- Parameters:
value- the valuetype- the type
-
Cell
Initializes a new instance of the Cell class.- Parameters:
value- the value
-
Cell
public Cell(double value)Initializes a new instance of the Cell class.- Parameters:
value- the value
-
Cell
public Cell(boolean value)Initializes a new instance of the Cell class.- Parameters:
value- the value
-
Cell
Initializes a new instance of the Cell class.- Parameters:
value- the value
-
-
Method Details
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin interfaceIContentElement- Returns:
- A collection of content elements.
-
getParent
Returns the parent content element.- Specified by:
getParentin interfaceIContentElement- Returns:
- the parent
-
setParent
Sets the parent content element.- Specified by:
setParentin interfaceIContentElement- Parameters:
parent- the new parent
-
clone
Creates a new object that is a deep copy of the current instance.- Specified by:
clonein interfaceIContentElement- Overrides:
clonein classObject- Returns:
- A new object that is a copy of this instance.
-
toString
Converts the value of the current Cell object to its equivalent string representation. -
getContent
Gets the content.- Returns:
- the content
-
getNumberOfRepeatedCells
public int getNumberOfRepeatedCells()Gets the number of successive columns in which a cell is repeated. It may be used to describe two or more adjoining cells with a single cell element, if they meet the following conditions: - The cells contain the same content and style. - The cells are not merged horizontally or vertically.- Returns:
- the number of repeated cells
-
setNumberOfRepeatedCells
public void setNumberOfRepeatedCells(int numberOfRepeatedCells)Sets the number of successive columns in which a cell is repeated. It may be used to describe two or more adjoining cells with a single cell element, if they meet the following conditions: - The cells contain the same content and style. - The cells are not merged horizontally or vertically.- Parameters:
numberOfRepeatedCells- the new number of repeated cells
-
getSpannedColumnsCount
public int getSpannedColumnsCount()Gets the number of columns that a cell spans.- Returns:
- the spanned columns count
-
setSpannedColumnsCount
public void setSpannedColumnsCount(int spannedColumnsCount)Sets the number of columns that a cell spans.- Parameters:
spannedColumnsCount- the new spanned columns count
-
getSpannedRowsCount
public int getSpannedRowsCount()Gets the number of rows that a cell spans.- Returns:
- the spanned rows count
-
setSpannedRowsCount
public void setSpannedRowsCount(int spannedRowsCount)Sets the number of rows that a cell spans.- Parameters:
spannedRowsCount- the new spanned rows count
-
getMatrixColumnsSpannedCount
public int getMatrixColumnsSpannedCount()Gets the number of columns spanned by a matrix.- Returns:
- the matrix columns spanned count
-
setMatrixColumnsSpannedCount
public void setMatrixColumnsSpannedCount(int matrixColumnsSpannedCount)Sets the number of columns spanned by a matrix.- Parameters:
matrixColumnsSpannedCount- the new matrix columns spanned count
-
getMatrixRowsSpannedCount
public int getMatrixRowsSpannedCount()Gets the number of rows spanned by a matrix.- Returns:
- the matrix rows spanned count
-
setMatrixRowsSpannedCount
public void setMatrixRowsSpannedCount(int matrixRowsSpannedCount)Sets the number of rows spanned by a matrix.- Parameters:
matrixRowsSpannedCount- the new matrix rows spanned count
-
getFormula
Gets the formula for a table cell.- Returns:
- the formula
-
setFormula
Sets the formula for a table cell.- Parameters:
formula- the new formula
-
getCurrency
Gets the currency for a value of a table cell, a text field, or a form property.- Returns:
- the currency
-
setCurrency
Sets the currency for a value of a table cell, a text field, or a form property.- Parameters:
currency- the new currency
-
getStyle
Gets the style of table cell.- Returns:
- the style
-
setStyle
Sets the style of table cell.- Parameters:
style- the new style
-
getContentValidation
Specifies if a cell contains a validity check. The value of this attribute is a name found in the name attribute of a ContentValidation. If this attribute is not present, a cell may have arbitrary content.- Returns:
- the content validation
-
setContentValidation
Specifies if a cell contains a validity check. The value of this attribute is a name found in the name attribute of a ContentValidation. If this attribute is not present, a cell may have arbitrary content.- Parameters:
contentValidation- the new content validation
-
getType
Gets the value-type of a table cell, a text field, or a form property.- Returns:
- the type
-
setType
Sets the value-type of a table cell, a text field, or a form property.- Parameters:
type- the new type
-
getValue
Gets the currency, float or percentage value for a table cell, a text field, or a form property.- Returns:
- the value
-
setValue
Sets the currency, float or percentage value for a table cell, a text field, or a form property.- Parameters:
value- the new value
-