- java.lang.Object
-
- com.pervasive.datarush.encoding.text.DurationFormatter
-
- All Implemented Interfaces:
TokenFormatter
public class DurationFormatter extends Object
-
-
Constructor Summary
Constructors Constructor Description DurationFormatter(IntervalFormatting format, String nullIndicator)
Creates a formatter using the specified format.DurationFormatter(String format)
Creates a formatter using the specified format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format()
Formats the current value of the source as a text value.void
setSource(ScalarValued source)
Sets the container holding values to be formatted.
-
-
-
Constructor Detail
-
DurationFormatter
public DurationFormatter(String format)
Creates a formatter using the specified format. Null values are output as the empty string.- Parameters:
format
- the output format to use
-
DurationFormatter
public DurationFormatter(IntervalFormatting format, String nullIndicator)
Creates a formatter using the specified format. Null values are output as the specified string.- Parameters:
format
- the output format to usenullIndicator
- the text value to use for null values
-
-
Method Detail
-
setSource
public final void setSource(ScalarValued source)
Description copied from interface:TokenFormatter
Sets the container holding values to be formatted. A reference to this container is held and accessed only when an formatting is requested.- Specified by:
setSource
in interfaceTokenFormatter
- Parameters:
source
- the value container to format
-
format
public final String format()
Description copied from interface:TokenFormatter
Formats the current value of the source as a text value.- Specified by:
format
in interfaceTokenFormatter
- Returns:
- the value of the source as a string
-
-