jdk/src/share/classes/java/text/FieldPosition.java
changeset 19054 a64012cb49d6
parent 5506 202f599c92aa
child 21278 ef8a3a2a72f2
equal deleted inserted replaced
19053:69648476a89e 19054:a64012cb49d6
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    98     /**
    98     /**
    99      * Creates a FieldPosition object for the given field.  Fields are
    99      * Creates a FieldPosition object for the given field.  Fields are
   100      * identified by constants, whose names typically end with _FIELD,
   100      * identified by constants, whose names typically end with _FIELD,
   101      * in the various subclasses of Format.
   101      * in the various subclasses of Format.
   102      *
   102      *
       
   103      * @param field the field identifier
   103      * @see java.text.NumberFormat#INTEGER_FIELD
   104      * @see java.text.NumberFormat#INTEGER_FIELD
   104      * @see java.text.NumberFormat#FRACTION_FIELD
   105      * @see java.text.NumberFormat#FRACTION_FIELD
   105      * @see java.text.DateFormat#YEAR_FIELD
   106      * @see java.text.DateFormat#YEAR_FIELD
   106      * @see java.text.DateFormat#MONTH_FIELD
   107      * @see java.text.DateFormat#MONTH_FIELD
   107      */
   108      */
   155         return attribute;
   156         return attribute;
   156     }
   157     }
   157 
   158 
   158     /**
   159     /**
   159      * Retrieves the field identifier.
   160      * Retrieves the field identifier.
       
   161      *
       
   162      * @return the field identifier
   160      */
   163      */
   161     public int getField() {
   164     public int getField() {
   162         return field;
   165         return field;
   163     }
   166     }
   164 
   167 
   165     /**
   168     /**
   166      * Retrieves the index of the first character in the requested field.
   169      * Retrieves the index of the first character in the requested field.
       
   170      *
       
   171      * @return the begin index
   167      */
   172      */
   168     public int getBeginIndex() {
   173     public int getBeginIndex() {
   169         return beginIndex;
   174         return beginIndex;
   170     }
   175     }
   171 
   176 
   172     /**
   177     /**
   173      * Retrieves the index of the character following the last character in the
   178      * Retrieves the index of the character following the last character in the
   174      * requested field.
   179      * requested field.
       
   180      *
       
   181      * @return the end index
   175      */
   182      */
   176     public int getEndIndex() {
   183     public int getEndIndex() {
   177         return endIndex;
   184         return endIndex;
   178     }
   185     }
   179 
   186 
   180     /**
   187     /**
   181      * Sets the begin index.  For use by subclasses of Format.
   188      * Sets the begin index.  For use by subclasses of Format.
       
   189      *
       
   190      * @param bi the begin index
   182      * @since 1.2
   191      * @since 1.2
   183      */
   192      */
   184     public void setBeginIndex(int bi) {
   193     public void setBeginIndex(int bi) {
   185         beginIndex = bi;
   194         beginIndex = bi;
   186     }
   195     }
   187 
   196 
   188     /**
   197     /**
   189      * Sets the end index.  For use by subclasses of Format.
   198      * Sets the end index.  For use by subclasses of Format.
       
   199      *
       
   200      * @param ei the end index
   190      * @since 1.2
   201      * @since 1.2
   191      */
   202      */
   192     public void setEndIndex(int ei) {
   203     public void setEndIndex(int ei) {
   193         endIndex = ei;
   204         endIndex = ei;
   194     }
   205     }