borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.model
java.lang.Object +----borland.jbcl.model.ItemFormatter +----borland.jbcl.model.VariantFormatter +----borland.jbcl.model.SimpleFormatter
Constructors Properties MethodsThe SimpleFormatter class 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.
See also: Edit/display mask patterns
public SimpleFormatter()Constructs a SimpleFormatter object.
public SimpleFormatter(int variantType)Constructs a SimpleFormatter object that instantiates a VariantFormatStr object of the specified Variant type.
Parameters:
public Format getFormatObj()Calls the getFormatObj() method of the VariantFormatStr object, returning the format object.
public Locale getLocale()Calls the getLocale() method of the VariantFormatStr object, returning the locale.
public String getPattern()Calls the getPattern() method of the VariantFormatStr object, returning the default pattern.
public int getVariantType()Calls the getVariantType() method of the VariantFormatStr object, returning the Variant type.
public String format(borland.jbcl.util.Variant value)Calls the format() method of the VariantFormatStr object, returning the formatted string.
Overrides: borland.jbcl.model.VariantFormatter.format(borland.jbcl.util.Variant)
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().
Parameters:
Overrides: borland.jbcl.model.VariantFormatter.getSpecialObject(int)
public void parse(java.lang.String stringValue, borland.jbcl.util.Variant value)Analyzes the given String and produces as output a Variant containing the approriate value.
Parameters:
Overrides: borland.jbcl.model.VariantFormatter.parse(java.lang.String, borland.jbcl.util.Variant)
public void parse(java.lang.String stringValue, borland.jbcl.util.Variant value, int variantType)
Overrides: borland.jbcl.model.VariantFormatter.parse(java.lang.String, borland.jbcl.util.Variant, int)
public String setPattern(java.lang.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.
Parameters:
Overrides: borland.jbcl.model.VariantFormatter.setPattern(java.lang.String)
public Object setSpecialObject(int objType, java.lang.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.
Parameters:
Overrides: borland.jbcl.model.VariantFormatter.setSpecialObject(int, java.lang.Object)