Class Time
java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.Time
- All Implemented Interfaces:
IContentElement,IParagraphContent
Represents a time, by default this is the current time.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionTime()Initializes a new instance of the Time class.Time(InternalXMLStreamReader reader)Instantiates a new time. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.Gets the adjustment of the value of a time by a certain time period.Returns all content elements.Returns the parent content element.getStyle()Gets the data style to format a numeric value.Gets the time at which a document was last edited.getValue()Gets the time.booleanisFixed()Specifies whether the value of a field element is fixed.voidsetAdjustment(String adjustment)Sets the adjustment of the value of a time by a certain time period.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.voidsetTimeValue(String timeValue)Sets the time at which a document was last edited.voidSets the time.toString()Converts the value of the current Time object to its equivalent string representation.
-
Constructor Details
-
Time
public Time()Initializes a new instance of the Time class. -
Time
Instantiates a new time.- 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 Time object to its equivalent string representation. -
getTimeValue
Gets the time at which a document was last edited.- Returns:
- the time value
-
setTimeValue
Sets the time at which a document was last edited.- Parameters:
timeValue- the new time value
-
getValue
Gets the time.- Returns:
- the value
-
setValue
Sets the time.- 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
-
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
-
getAdjustment
Gets the adjustment of the value of a time by a certain time period. Positive values adjust the time to a time in the future, while negative values adjust the time to a time in the past. The duration is truncated to full minutes.- Returns:
- the adjustment
-
setAdjustment
Sets the adjustment of the value of a time by a certain time period. Positive values adjust the time to a time in the future, while negative values adjust the time to a time in the past. The duration is truncated to full minutes.- Parameters:
adjustment- the new adjustment
-