java.text
Interface Format.FieldDelegate

All Known Implementing Classes:
CharacterIteratorFieldDelegate, FieldPosition.Delegate
Enclosing interface:
Format

static interface Format.FieldDelegate

FieldDelegate is notified by the various Format implementations as they are formatting the Objects. This allows for storage of the individual sections of the formatted String for later use, such as in a FieldPosition or for an AttributedCharacterIterator.

Delegates should NOT assume that the Format will notify the delegate of fields in any particular order.

See Also:
FieldPosition.Delegate, CharacterIteratorFieldDelegate

Method Summary
 void formatted(Format.Field attr, Object value, int start, int end, StringBuffer buffer)
          Notified when a particular region of the String is formatted.
 void formatted(int fieldID, Format.Field attr, Object value, int start, int end, StringBuffer buffer)
          Notified when a particular region of the String is formatted.
 

Method Detail

formatted

public void formatted(Format.Field attr,
                      Object value,
                      int start,
                      int end,
                      StringBuffer buffer)
Notified when a particular region of the String is formatted. This method will be invoked if there is no corresponding integer field id matching attr.

Parameters:
attr - Identifies the field matched
value - Value associated with the field
start - Beginning location of the field, will be >= 0
end - End of the field, will be >= start and <= buffer.length()
buffer - Contains current formatted value, receiver should NOT modify it.

formatted

public void formatted(int fieldID,
                      Format.Field attr,
                      Object value,
                      int start,
                      int end,
                      StringBuffer buffer)
Notified when a particular region of the String is formatted.

Parameters:
fieldID - Identifies the field by integer
attr - Identifies the field matched
value - Value associated with the field
start - Beginning location of the field, will be >= 0
end - End of the field, will be >= start and <= buffer.length()
buffer - Contains current formatted value, receiver should NOT modify it.