Class Date
java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.Date
- All Implemented Interfaces:
IContentElement,IParagraphContent
Displays a date, by default this is the current date. The date can be adjusted to display a date other than the current date.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDate()Initializes a new instance of the Date class.Date(InternalXMLStreamReader reader)Instantiates a new date. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.Gets an adjustment to the value of a date field.Returns all content elements.Gets the date value.Returns the parent content element.getStyle()Gets the data style to format a numeric value.getValue()Gets date value.booleanisFixed()Specifies whether the value of a field element is fixed.voidsetAdjustment(String adjustment)Sets an adjustment to the value of a date field.voidsetDateValue(String dateValue)Sets the date value.voidsetFixed(boolean isFixed)Specifies whether the value of a field element is fixed.voidsetParent(IContentElement parent)Sets the parent content element.voidSets the data style to format a numeric value.voidSets date value.toString()Converts the value of the current Date object to its equivalent string representation.
-
Constructor Details
-
Date
public Date()Initializes a new instance of the Date class. -
Date
Instantiates a new date.- Parameters:
reader- the reader- Throws:
XMLStreamException- the xML stream exception
-
-
Method Details
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin interfaceIContentElement- Specified by:
getContentElementsin classField- Returns:
- A collection of content elements.
-
getParent
Returns the parent content element.- Specified by:
getParentin interfaceIContentElement- Overrides:
getParentin classField- Returns:
- the parent
-
setParent
Sets the parent content element.- Specified by:
setParentin interfaceIContentElement- Overrides:
setParentin classField- Parameters:
parent- the new parent
-
clone
Creates a new object that is a deep copy of the current instance.- Specified by:
clonein interfaceIContentElement- Specified by:
clonein interfaceIParagraphContent- Specified by:
clonein classField- Returns:
- A new object that is a copy of this instance.
-
toString
Converts the value of the current Date object to its equivalent string representation. -
getDateValue
Gets the date value. This attribute can also be used to specify a future date. If no value is specified, whether the field is marked as fixed or not, the current date is assumed.- Returns:
- the date value
-
setDateValue
Sets the date value. This attribute can also be used to specify a future date. If no value is specified, whether the field is marked as fixed or not, the current date is assumed.- Parameters:
dateValue- the new date value
-
getStyle
Gets the data style to format a numeric value.- Returns:
- the style
-
setStyle
Sets the data style to format a numeric value.- Parameters:
style- the new style
-
getValue
Gets date value.- Returns:
- the value
-
setValue
Sets date value.- Parameters:
value- the new value
-
isFixed
public boolean isFixed()Specifies whether the value of a field element is fixed. The defined values are: - false: value of field element may be replaced with a new value in future edits. - true: value of field element shall be preserved in future edits.- Returns:
- true, if is fixed
-
setFixed
public void setFixed(boolean isFixed)Specifies whether the value of a field element is fixed. The defined values are: - false: value of field element may be replaced with a new value in future edits. - true: value of field element shall be preserved in future edits.- Parameters:
isFixed- the new fixed
-
getAdjustment
Gets an adjustment to the value of a date field. If the time period is negative, it gets subtracted from the value of the date field, yielding a date before the current date.- Returns:
- the adjustment
-
setAdjustment
Sets an adjustment to the value of a date field. If the time period is negative, it gets subtracted from the value of the date field, yielding a date before the current date.- Parameters:
adjustment- the new adjustment
-