Class WordScanner

java.lang.Object
  extended by WordScanner

public class WordScanner
extends java.lang.Object

Scans a word at a time from a named file

Version:
Fall 2013
Author:
Philip Howard, Joel Ross

Constructor Summary
WordScanner(java.lang.String fileName)
          Constructor for objects of class WordScanner
 
Method Summary
 boolean hasNextWord()
          Returns true if there is another word in the Scanner
 java.lang.String nextWord()
          Finds and returns the next token from the Scanner
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordScanner

public WordScanner(java.lang.String fileName)
Constructor for objects of class WordScanner

Parameters:
fileName - The name of the file to scan
Method Detail

hasNextWord

public boolean hasNextWord()
Returns true if there is another word in the Scanner

Returns:
true if and only if this scanner has another token

nextWord

public java.lang.String nextWord()
Finds and returns the next token from the Scanner

Returns:
the next token. null if there is no such token.