src/share/classes/java/util/Scanner.java

Print this page




 326  *                 </tt><i>NonNumber</i><tt>
 327  *                 </tt><i>LocalNegativeSuffix</i></td></tr>
 328  *
 329  *   <tr><td>&nbsp;</td></tr>
 330  *
 331  *   <tr><td valign=top align=right>
 332  *         <a name="Float-regex"><i>Float</i>&nbsp;&nbsp;::</td>
 333  *       <td valign=top><tt>= </tt><i>Decimal</i><tt></td></tr>
 334  *       <tr><td></td>
 335  *           <td><tt>| </tt><i>HexFloat</i><tt></td></tr>
 336  *       <tr><td></td>
 337  *           <td><tt>| </tt><i>SignedNonNumber</i><tt></td></tr>
 338  *
 339  * </table>
 340  * </center>
 341  *
 342  * <p> Whitespace is not significant in the above regular expressions.
 343  *
 344  * @since   1.5
 345  */
 346 public final class Scanner implements Iterator<String> {
 347 
 348     // Internal buffer used to hold input
 349     private CharBuffer buf;
 350 
 351     // Size of internal character buffer
 352     private static final int BUFFER_SIZE = 1024; // change to 1024;
 353 
 354     // The index into the buffer currently held by the Scanner
 355     private int position;
 356 
 357     // Internal matcher used for finding delimiters
 358     private Matcher matcher;
 359 
 360     // Pattern used to delimit tokens
 361     private Pattern delimPattern;
 362 
 363     // Pattern found in last hasNext operation
 364     private Pattern hasNextPattern;
 365 
 366     // Position after last hasNext operation




 326  *                 </tt><i>NonNumber</i><tt>
 327  *                 </tt><i>LocalNegativeSuffix</i></td></tr>
 328  *
 329  *   <tr><td>&nbsp;</td></tr>
 330  *
 331  *   <tr><td valign=top align=right>
 332  *         <a name="Float-regex"><i>Float</i>&nbsp;&nbsp;::</td>
 333  *       <td valign=top><tt>= </tt><i>Decimal</i><tt></td></tr>
 334  *       <tr><td></td>
 335  *           <td><tt>| </tt><i>HexFloat</i><tt></td></tr>
 336  *       <tr><td></td>
 337  *           <td><tt>| </tt><i>SignedNonNumber</i><tt></td></tr>
 338  *
 339  * </table>
 340  * </center>
 341  *
 342  * <p> Whitespace is not significant in the above regular expressions.
 343  *
 344  * @since   1.5
 345  */
 346 public final class Scanner implements Iterator<String>, Closeable {
 347 
 348     // Internal buffer used to hold input
 349     private CharBuffer buf;
 350 
 351     // Size of internal character buffer
 352     private static final int BUFFER_SIZE = 1024; // change to 1024;
 353 
 354     // The index into the buffer currently held by the Scanner
 355     private int position;
 356 
 357     // Internal matcher used for finding delimiters
 358     private Matcher matcher;
 359 
 360     // Pattern used to delimit tokens
 361     private Pattern delimPattern;
 362 
 363     // Pattern found in last hasNext operation
 364     private Pattern hasNextPattern;
 365 
 366     // Position after last hasNext operation