Known Direct Subclasses
| DateFormat |
DateFormat is the abstract superclass of formats which format and parse
Dates. |
| MessageFormat |
MessageFormat is used to format and parse arguments based on a pattern. |
| NumberFormat |
NumberFormat is the abstract superclass of Formats which format and parse
Numbers. |
|
Known Indirect Subclasses
| ChoiceFormat |
ChoiceFormat is used to associate strings with ranges of double values. |
| DecimalFormat |
DecimalFormat is used to format and parse numbers, both integers and
fractions, based on a pattern. |
| SimpleDateFormat |
SimpleDateFormat is used to format and parse Gregorian calendar dates and
times based on a pattern of date and time fields. |
|
Class Overview
Format is the abstract superclass of classes which format and parse objects
according to Locale specific rules.
Summary
| Nested Classes |
|
public
abstract
class |
Format.Field |
This inner class is used to represent Format attributes in the
AttributedCharacterIterator that formatToCharacterIterator() method
returns in the Format subclasses. |
| Public Constructors |
|
|
Format()
Constructs a new instance of Format.
|
|
[Expand]
Inherited Methods |
From class java.lang.Object
|
Object
|
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
|
|
boolean
|
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
|
void
|
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver.
|
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of java.lang.Class which represents the class
of the receiver.
|
|
int
|
hashCode()
Returns an integer hash code for the receiver.
|
|
final
void
|
notify()
Causes one thread which is wait ing on the receiver to be
made ready to run.
|
|
final
void
|
notifyAll()
Causes all threads which are wait ing on the receiver to
be made ready to run.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
final
void
|
wait(long time, int frac)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait(long time)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait()
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll).
|
|
Public Constructors
public
Format
()
Constructs a new instance of Format.
Public Methods
public
Object
clone
()
Returns a copy of this Format.
Returns
- a shallow copy of this Format
Formats the specified object into the specified StringBuffer using the
rules of this Format. If the field specified by the FieldPosition is
formatted, set the begin and end index of the formatted field in the
FieldPosition.
Parameters
| object
| the object to format |
| buffer
| the StringBuffer |
| field
| the FieldPosition |
Returns
- the StringBuffer parameter
buffer
public
final
String
format
(Object object)
Formats the specified object using the rules of this Format.
Parameters
| object
| the object to format |
Formats the specified object using the rules of this format and returns
an AttributedCharacterIterator with the formatted String and no
attributes.
Subclasses should return an AttributedCharacterIterator with the
appropriate attributes.
Parameters
| object
| the object to format |
Returns
- an AttributedCharacterIterator with the formatted object and
attributes
Parse the specified String starting at the index specified by the
ParsePosition. If the string is successfully parsed, the index of the
ParsePosition is updated to the index following the parsed text.
Parameters
| string
| the String to parse |
| position
| the ParsePosition, updated on return with the index following
the parsed text, or on error the index is unchanged and the
error index is set to the index where the error occurred |
Returns
- the object resulting from the parse, or null if there is an error
public
Object
parseObject
(String string)
Parse the specified String using the rules of this Format.
Parameters
| string
| the String to parse |
Returns
- the object resulting from the parse