Package de.zedlitz.opendocument
Class Cell
java.lang.Object
de.zedlitz.opendocument.Cell
- Direct Known Subclasses:
EmptyCell
- Author:
- Jesper Zedlitz <jze@informatik.uni-kiel.de>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the boolean value of the cell.asDate()Return aLocalDateobject with the value of the cell.Return aLocalDateTimeobject with the value of the cell.asTime()Return aLocalTimeobject with the value of the cell.Get the raw value of theboolean-valueattribute.intReturns the content of the cell formatted for the locale of the file.Get the raw value of thecurrencyattribute.Get the raw value of thedate-valueattribute.Returns the language independent value of a cell.intGet the raw value of thetime-valueattribute.getValue()Returns the language independent value of a cell.Get the raw value of thevalue-typeattribute.booleanDoes the cell contain a value that consists of a date and a time?toString()
-
Field Details
-
TYPE_UNDEFINED
- See Also:
-
-
Method Details
-
getCurrency
Get the raw value of thecurrencyattribute. It is only present for cells with the type "currency".- Returns:
- the raw currency value or
nullif not present.
-
getTimeValue
Get the raw value of thetime-valueattribute. It is only present for cells with the type "time".- Returns:
- the raw time value or
nullif not present.
-
getBooleanValue
Get the raw value of theboolean-valueattribute. It is only present for cells with the type "boolean".- Returns:
- the raw boolean value or
nullif not present.
-
getDateValue
Get the raw value of thedate-valueattribute. It is only present for cells with the type "date".- Returns:
- the raw date value or
nullif not present.
-
getValueType
Get the raw value of thevalue-typeattribute. It should be present for every cell.- Returns:
- Returns the valueType or
nullif not present.
-
getContent
Returns the content of the cell formatted for the locale of the file. For example in a German ods file the boolean valuetruewill be returned asWAHR. In a French ods file it will beVRAI. And in an English ods file it will beTRUE.If you are looking for a language independent value you can use the getValue method.
-
getNumberColumnsRepeated
public int getNumberColumnsRepeated() -
toString
-
asBoolean
public boolean asBoolean()Return the boolean value of the cell. This works only for cells with the type "boolean". Check for"boolean".equals(cell.getValueType())before invoking this method.- Returns:
- a
LocalDateobject with the value of the cell. - Throws:
OdsReaderException- is the cell is not a boolean cell
-
asDate
Return aLocalDateobject with the value of the cell. This works only for cells with the type "date" and do not have a time component. Check for"date".equals(cell.getValueType())before invoking this method.- Returns:
- a
LocalDateobject with the value of the cell. - Throws:
OdsReaderException- is the cell is not a date cell
-
asDateTime
Return aLocalDateTimeobject with the value of the cell. This works only for cells with the type "date". Check for"date".equals(cell.getValueType())before invoking this method. If the cell contains only a date and no time the time00:00:00will be used as the time component.- Returns:
- a
LocalDateTimeobject with the value of the cell. - Throws:
OdsReaderException- is the cell is not a date cell
-
isDateTime
public boolean isDateTime()Does the cell contain a value that consists of a date and a time? -
asTime
Return aLocalTimeobject with the value of the cell. This works only for cells with the type "time". Check for"time".equals(cell.getValueType())before invoking this method.- Returns:
- a
LocalTimeobject with the value of the cell. - Throws:
OdsReaderException- is the cell is not a time cell
-
getColumnIndex
public int getColumnIndex() -
getAddress
-
getValue
Returns the language independent value of a cell. This is only present for cell with the type float, currency, and percentage. It is stored in thevalueattribute of the cell element.If getValue() is
nullyou can use getContent() to get the text value of the cell.- Returns:
- the language independent value of a cell or
nullif not value is present.
-
getLanguageIndependentContent
Returns the language independent value of a cell.It is the contents of the
contentor thevalueattribute of the cell element.
-