Android
java.util
public interface

java.util.Formattable

java.util.Formattable

Any class that need to perform customer formatting by transferring converter specifier 's' to Formatter should implement the Formattable interface. Basic format is allowed by the interface to format arbitrary objects.

Summary

Public Methods

          void  formatTo(Formatter formatter, int flags, int width, int precision)
Formats the object using the specified formatter.

Details

Public Methods

public void formatTo(Formatter formatter, int flags, int width, int precision)

Formats the object using the specified formatter.

Parameters

formatter The formatter to use in the formatTo.
flags The flags applied to the output format, which is a bitmask that is any combination of FormattableFlags.LEFT_JUSTIFY, FormattableFlags.UPPERCASE, and FormattableFlags.ALTERNATE. If no such flag is set, the output is formatted by the default formatting of the implementation of the interface.
width The minimum number of characters that should be written to the output. Additional space ' ' is added to the output if the length of the converted value is less than the width until the length equals the width. These spaces are added at the beginning by default unless the flag FormattableFlags.LEFT_JUSTIFY is set, which denotes that padding should be added at the end. If width is -1, then no minimum requirement.
precision The maximum number of characters that can be written to the output. The procedure to trunk the output according to the precision is invoked before that of padding to width. If the precision is -1, then no maximum requirement.

Throws

IllegalFormatException If any of the parameters is not supported.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48