/** * Formats an Object producing an <code>AttributedCharacterIterator</code>. * You can use the returned <code>AttributedCharacterIterator</code> * to build the resulting String, as well as to determine information * about the resulting String. * <p> * Each attribute key of the AttributedCharacterIterator will be of type * <code>Field</code>. It is up to each <code>Format</code> implementation * to define what the legal values are for each attribute in the * <code>AttributedCharacterIterator</code>, but typically the attribute * key is also used as the attribute value. * <p>The default implementation creates an * <code>AttributedCharacterIterator</code> with no attributes. Subclasses * that support fields should override this and create an * <code>AttributedCharacterIterator</code> with meaningful attributes. * * @exception NullPointerException if obj is null. * @exception IllegalArgumentException when the Format cannot format the * given object. * @param obj The object to format * @return AttributedCharacterIterator describing the formatted value. * @since 1.4 */ public AttributedCharacterIterator formatToCharacterIterator(Object obj) { return createAttributedCharacterIterator(format(obj)); }
/** * Formats an Object producing an <code>AttributedCharacterIterator</code>. * You can use the returned <code>AttributedCharacterIterator</code> * to build the resulting String, as well as to determine information * about the resulting String. * <p> * Each attribute key of the AttributedCharacterIterator will be of type * <code>Field</code>. It is up to each <code>Format</code> implementation * to define what the legal values are for each attribute in the * <code>AttributedCharacterIterator</code>, but typically the attribute * key is also used as the attribute value. * <p>The default implementation creates an * <code>AttributedCharacterIterator</code> with no attributes. Subclasses * that support fields should override this and create an * <code>AttributedCharacterIterator</code> with meaningful attributes. * * @exception NullPointerException if obj is null. * @exception IllegalArgumentException when the Format cannot format the * given object. * @param obj The object to format * @return AttributedCharacterIterator describing the formatted value. * @since 1.4 */ public AttributedCharacterIterator formatToCharacterIterator(Object obj) { return createAttributedCharacterIterator(format(obj)); }