Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.text

Class Format

java.lang.Object
|
+--java.text.Format

All Implemented Interfaces:

Serializable, Cloneable


public abstract class Format

extends Object

implements Serializable, Cloneable

This class is the abstract superclass of classes that format and parse data to/from Strings. It is guaranteed that any String produced by a concrete subclass of Format will be parseable by that same subclass.

In addition to implementing the abstract methods in this class, subclasses should provide static factory methods of the form getInstance() and getInstance(Locale) if the subclass loads different formatting/parsing schemes based on locale. These subclasses should also implement a static method called getAvailableLocales() which returns an array of available locales in the current runtime environment.

Authors:

Constructor Summary

Format()

This method initializes a new instance of Format.

Method Summary

java.lang.Objectclone()

Creates a copy of this object.
java.lang.Stringformat(java.lang.Object obj)

This method formats an Object into a String.
java.lang.StringBufferformat(java.lang.Object obj, java.lang.StringBuffer sb, java.text.FieldPosition pos)

This method formats an Object into a String and appends the String to a StringBuffer.
java.lang.ObjectparseObject(java.lang.String str)

This method parses a String and converts the parsed contents into an Object.
java.lang.ObjectparseObject(java.lang.String str, java.text.ParsePosition pos)

This method parses a String and converts the parsed contents into an Object.

Constructor Details

Format

public Format()

This method initializes a new instance of Format. It performs no actions, but acts as a default constructor for subclasses.


Method Details

clone

public Object clone()

Creates a copy of this object.

Returns:


format

public final String format(java.lang.Object obj)

This method formats an Object into a String.

Parameters:

Returns:

Throws:


format

public StringBuffer format(java.lang.Object obj, java.lang.StringBuffer sb, java.text.FieldPosition pos)

This method formats an Object into a String and appends the String to a StringBuffer.

Parameters:

Returns:

Throws:


parseObject

public Object parseObject(java.lang.String str)

This method parses a String and converts the parsed contents into an Object.

Parameters:

Returns:

Throws:


parseObject

public Object parseObject(java.lang.String str, java.text.ParsePosition pos)

This method parses a String and converts the parsed contents into an Object.

Parameters:

Returns: