borland Packages Class Hierarchy dx.text Package
java.lang.Object +----com.borland.dx.text.ItemFormatter +----com.borland.dx.text.VariantFormatter +----com.borland.dx.text.SimpleFormatter
Constructors Properties Methods
Implements Serializable
The SimpleFormatter component is a wrapper for the VariantFormatStr class. It is a simple implementation of a formating and parsing class that uses the default locale and the default control pattern for the particular Variant that is passed to it.
public SimpleFormatter()Constructs a SimpleFormatter object.
public SimpleFormatter(int variantType)Constructs a SimpleFormatter object that instantiates a VariantFormatStr object of the specified Variant type.
public Format getFormatObj()Calls getFormatObj() of the VariantFormatStr object, returning the format object.
public Locale getLocale()Calls getLocale() of the VariantFormatStr object, returning the locale.
public String getPattern()Calls getPattern() of the VariantFormatStr object, returning the default pattern.
public int getVariantType()Calls getVariantType() of the VariantFormatStr object, returning the Variant type.
public String format(Variant value)Calls the format() method of the VariantFormatStr object, returning the formatted string.
public Object getSpecialObject(int objType)Calls the getSpecialObject() method of the VariantFormatStr object, returning the special object.
Some Formatter classes define special objects for their own use. You must know the internal details of the Format subclass being used to use getSpecialObject().
public void parse(String stringValue, Variant value)Analyzes the given String and produces as output a Variant containing the approriate value.
public void parse(String stringValue, Variant value, int variantType)Analyzes the given String and produces as output a Variant containing the approriate value.
public String setPattern(String pattern)Sets the pattern used for parsing and formatting to a new pattern, returning the old pattern. The new pattern must be of the same basic type associated with this type of formatter. For example, if you used a Date/Time pattern in the constructor, you can't switch to a numeric pattern as each basic pattern type has its own data-dependent format() and parse() methods.
If the new pattern is null (or empty), setPattern() chooses a default pattern for the current locale.
public Object setSpecialObject(int objType, Object obj)Some Formatter classes define special objects for their own use. This method allows them to be set. You must know the internal details of the Format subclass being used to use setSpecialObject().
The returned value is the prior value of the object.