< prev index next >

src/java.base/share/classes/java/text/FieldPosition.java

Print this page




  51  * </ul>
  52  * <p>
  53  * <code>FieldPosition</code> keeps track of the position of the
  54  * field within the formatted output with two indices: the index
  55  * of the first character of the field and the index of the last
  56  * character of the field.
  57  *
  58  * <p>
  59  * One version of the <code>format</code> method in the various
  60  * <code>Format</code> classes requires a <code>FieldPosition</code>
  61  * object as an argument. You use this <code>format</code> method
  62  * to perform partial formatting or to get information about the
  63  * formatted output (such as the position of a field).
  64  *
  65  * <p>
  66  * If you are interested in the positions of all attributes in the
  67  * formatted string use the <code>Format</code> method
  68  * <code>formatToCharacterIterator</code>.
  69  *
  70  * @author      Mark Davis

  71  * @see         java.text.Format
  72  */
  73 public class FieldPosition {
  74 
  75     /**
  76      * Input: Desired field to determine start and end offsets for.
  77      * The meaning depends on the subclass of Format.
  78      */
  79     int field = 0;
  80 
  81     /**
  82      * Output: End offset of field in text.
  83      * If the field does not occur in the text, 0 is returned.
  84      */
  85     int endIndex = 0;
  86 
  87     /**
  88      * Output: Start offset of field in text.
  89      * If the field does not occur in the text, 0 is returned.
  90      */




  51  * </ul>
  52  * <p>
  53  * <code>FieldPosition</code> keeps track of the position of the
  54  * field within the formatted output with two indices: the index
  55  * of the first character of the field and the index of the last
  56  * character of the field.
  57  *
  58  * <p>
  59  * One version of the <code>format</code> method in the various
  60  * <code>Format</code> classes requires a <code>FieldPosition</code>
  61  * object as an argument. You use this <code>format</code> method
  62  * to perform partial formatting or to get information about the
  63  * formatted output (such as the position of a field).
  64  *
  65  * <p>
  66  * If you are interested in the positions of all attributes in the
  67  * formatted string use the <code>Format</code> method
  68  * <code>formatToCharacterIterator</code>.
  69  *
  70  * @author      Mark Davis
  71  * @since 1.1
  72  * @see         java.text.Format
  73  */
  74 public class FieldPosition {
  75 
  76     /**
  77      * Input: Desired field to determine start and end offsets for.
  78      * The meaning depends on the subclass of Format.
  79      */
  80     int field = 0;
  81 
  82     /**
  83      * Output: End offset of field in text.
  84      * If the field does not occur in the text, 0 is returned.
  85      */
  86     int endIndex = 0;
  87 
  88     /**
  89      * Output: Start offset of field in text.
  90      * If the field does not occur in the text, 0 is returned.
  91      */


< prev index next >