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