A F G H I L M N P R S T U W

A

applyFilterToDirs - Variable in class FileIterator
 

F

fileFilter - Variable in class FileIterator
 
FileIterator - class FileIterator.
A FileIterator provides an iterator interface for enumerating all files in a directory.
FileIterator(File) - Constructor for class FileIterator
Constructor.
FileIterator(File, FileFilter) - Constructor for class FileIterator
Constructor which specifies both a File and a FileFilter.
fileLists - Variable in class FileIterator
fileLists is a stack of array iterators.

G

getCommand() - Static method in class MainHw4
Reads in one of three commands
getFileInfo(int) - Method in class WordGrabber
Gets identifying information about the file's contents, such as the file name and in some cases, its title and author.
getLastFileType() - Method in class FileIterator
Accessor function for lastFileType indicating the type of the last returned element.
getTwoSearchWords() - Static method in class MainHw4
Read two search words.

H

hasNext() - Method in class FileIterator
Check whether there is a next File, either file or directory, to be returned.
hasNextFile() - Method in class FileIterator
Check whether there is a next file (not a directory) to be returned.

I

isCommon(String) - Method in class WordGrabber
Tests whether a word is "common", and should be ignored.
isIgnored(String) - Method in class WordGrabber
Tests whether a word will be ignored either because of being too short or because of being a common word.

L

lastFileType - Variable in class FileIterator
lastFileType is: 0 if last obtained element was a normal file 1 if last obtained element was a directory when first encountered 2 if last obtained element was a directory when just finished it contents The codes 1 and 2 will need to be checked when both useDirsDown and useDirsUp are true in order to tell whether it is the first or second time the directory is being returned.

M

main(String[]) - Static method in class MainHw4
 
MainHw4 - class MainHw4.
This is a skeleton of a main program for implementing a mini-search engine on text files.
MainHw4() - Constructor for class MainHw4
 

N

next() - Method in class FileIterator
Returns the next file or directory as an object.
nextElement() - Method in class FileIterator
Returns the next element which can be either a file or a directory.
nextElementAll() - Method in class FileIterator
Returns the next file or directory.
nextFile - Variable in class FileIterator
 
nextFile() - Method in class FileIterator
Returns the next element which is a file rather than a directory.
nextFileType - Variable in class FileIterator
 
nextWord() - Method in class WordGrabber
Returns the next non-common word from the file.

P

posNextWord() - Method in class WordGrabber
Tests whether the current file has a next word to be processed.
prettyPrint(String) - Static method in class MainHw4
Prints out a long string in 80 column width.
printableExtract(int, int, int) - Method in class WordGrabber
Gets a small portion of a file and formats it as a String suitably for printing.
printableExtractLen(int, int, int) - Method in class WordGrabber
Gets a small portion of a file and formats it as a String suitable for printing.
printExtractWithTwoWords(int, int, int) - Static method in class MainHw4
Prints a two line extract from a file, containing the words at the indicated position.
printFrequentWords() - Static method in class MainHw4
THIS IS SOME OLD CODE that I used to gather the common word file.
pushFileArrayIterator(File) - Method in class FileIterator
Adds a new file or new directory list onto the stack fileLists
pushFileArrayIterator(File[]) - Method in class FileIterator
Adds a new file list iterator onto the stack fileLists This is generally called with the list of files from a directory.

R

readWordsFromFiles() - Static method in class MainHw4
This is a demo routine that shows how to read words one at a time from the files.
recurseSubdirectories - Variable in class FileIterator
 
remove() - Method in class FileIterator
This is an unsupported operation and generates an exception

S

setDirectoryModes(boolean, boolean) - Method in class FileIterator
Sets the modes for returning directories with next() or nextElement().
setFilterMode(boolean) - Method in class FileIterator
Set whether the file filter applies to directories.
setRecursive(boolean) - Method in class FileIterator
Set whether subdirectories are recursively searched.
startNextFile() - Method in class WordGrabber
Start reading from a new file.

T

txtFileFilter - Static variable in class WordGrabber
This is the default file filter.

U

useDirsDown - Variable in class FileIterator
 
useDirsUp - Variable in class FileIterator
 

W

WordGrabber - class WordGrabber.
This class is responsible for reading words one at a time from a set of files.
WordGrabber() - Constructor for class WordGrabber
Start a new WordGrabber object.
WordGrabber(String, String) - Constructor for class WordGrabber
Start a new WordGrabber, but use a different directory than the default one.
WordGrabber(String, String, FileFilter) - Constructor for class WordGrabber
Start a new WordGrabber.

A F G H I L M N P R S T U W