borland Packages Class Hierarchy dx.text Package
java.lang.Object +----com.borland.dx.text.ItemFormatter +----com.borland.dx.text.VariantFormatter +----com.borland.dx.text.StringFormatter
Constructors Properties Methods
Implements Serializable
The StringFormatter
component formats and parses string data. It uses the pattern
property of ItemFormatter
to access the edit/display mask patterns that are used to format and parse the data.
public StringFormatter()Constructs a
StringFormatter
object.
public int getVariantType()Returns the
Variant
type of StringFormatter
, which is always Variant.STRING
for StringFormatter
.
public final String format(Variant value)Returns a
String
representing the given value stored in the supplied object. All reasonable attempts are made to "cast" the type found in the object into the appropriate type specified in the constructor of the implementing classes. A returned empty string indicates a null or empty input value. null means the formatting failed.
value
String
.
public void parse(Variant variant, char[] value, int offset, int len)A high-speed parse that parses directly into a character array.
variant
value
offset
len
public void parse(String stringValue, Variant value)Analyzes the given
String
and produces as output a Variant
containing the approriate value.
stringValue
value
Variant
that receives the parsed result.