java.text
Class FieldPosition.Delegate

java.lang.Object
  extended byjava.text.FieldPosition.Delegate
All Implemented Interfaces:
Format.FieldDelegate
Enclosing class:
FieldPosition

private class FieldPosition.Delegate
extends Object
implements Format.FieldDelegate

An implementation of FieldDelegate that will adjust the begin/end of the FieldPosition if the arguments match the field of the FieldPosition.


Field Summary
private  boolean encounteredField
          Indicates whether the field has been encountered before.
 
Constructor Summary
private FieldPosition.Delegate()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encounteredField

private boolean encounteredField
Indicates whether the field has been encountered before. If this is true, and formatted is invoked, the begin/end are not updated.

Constructor Detail

FieldPosition.Delegate

private FieldPosition.Delegate()
Method Detail

formatted

public void formatted(Format.Field attr,
                      Object value,
                      int start,
                      int end,
                      StringBuffer buffer)
Description copied from interface: Format.FieldDelegate
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.

Specified by:
formatted in interface Format.FieldDelegate
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)
Description copied from interface: Format.FieldDelegate
Notified when a particular region of the String is formatted.

Specified by:
formatted in interface Format.FieldDelegate
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.