| java.lang.Object java.text.Format
All known Subclasses: java.text.DateFormat, java.text.NumberFormat, java.text.MessageFormat,
Format | abstract public class Format implements Serializable,Cloneable(Code) | | Format is the abstract superclass of classes which format and parse objects
according to Locale specific rules.
|
Constructor Summary | |
public | Format() Constructs a new instance of Format. |
Method Summary | |
public Object | clone() Answers a copy of this Format. | String | convertPattern(String template, String fromChars, String toChars, boolean check) | final public String | format(Object object) Formats the specified object using the rules of this Format. | abstract public StringBuffer | format(Object object, StringBuffer buffer, FieldPosition field) Formats the specified object into the specified StringBuffer using the
rules of this Format. | public AttributedCharacterIterator | formatToCharacterIterator(Object object) Formats the specified object using the rules of this format and returns
an AttributedCharacterIterator with the formatted String and no
attributes. | static Object | getInternalField(String fieldName, Object target) | public Object | parseObject(String string) Parse the specified String using the rules of this Format. | abstract public Object | parseObject(String string, ParsePosition position) Parse the specified String starting at the index specified by the
ParsePosition. | static boolean | upTo(String string, ParsePosition position, StringBuffer buffer, char stop) | static boolean | upToWithQuotes(String string, ParsePosition position, StringBuffer buffer, char stop, char start) |
Format | public Format()(Code) | | Constructs a new instance of Format.
|
format | final public String format(Object object)(Code) | | Formats the specified object using the rules of this Format.
Parameters: object - the object to format the formatted String exception: IllegalArgumentException - when the object cannot be formatted by this Format |
format | abstract public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code) | | 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 Parameters: buffer - the StringBuffer Parameters: field - the FieldPosition the StringBuffer parameter buffer exception: IllegalArgumentException - when the object cannot be formatted by this Format |
formatToCharacterIterator | public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code) | | 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 an AttributedCharacterIterator with the formatted object andattributes exception: IllegalArgumentException - when the object cannot be formatted by this Format |
parseObject | public Object parseObject(String string) throws ParseException(Code) | | Parse the specified String using the rules of this Format.
Parameters: string - the String to parse the object resulting from the parse exception: ParseException - when an error occurs during parsing |
parseObject | abstract public Object parseObject(String string, ParsePosition position)(Code) | | 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 Parameters: position - the ParsePosition, updated on return with the index followingthe parsed text, or on error the index is unchanged and theerror index is set to the index where the error occurred the object resulting from the parse, or null if there is an error |
|
|