|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcs132.markov.Words
public class Words
This class provides static utility methods for coverting text files to a list of words, and for printing a iterator of words in a nicely formatted manner.
| Method Summary | |
|---|---|
static void |
addWords(java.io.Reader in,
java.util.List<java.lang.String> words)
Given an Reader, read text from it, break up according to white space, and add each word to the List passed as an argument. |
static java.util.Iterator<java.lang.String> |
characters(java.util.Iterator<java.lang.String> wordIterator)
Given an Iterator |
static void |
printCharacters(java.util.Iterator<java.lang.String> characters,
int maxColumn,
int maxCharacters)
Given an iterator over characters, print the words with word wrapping to fit within the specified number of columns. |
static void |
printCharacters(java.util.Iterator<java.lang.String> characters,
int maxColumn,
int maxCharacters,
java.io.PrintStream out)
Provides the same functionality as printCharacters(Iterator, int, int), except
that is allows a PrintStream to be specified, so that output
can be sent to a file. |
static void |
printWords(java.util.Iterator<java.lang.String> words,
int maxColumn,
int maxWords)
Given an iterator over words, print the words with word wrapping to fit within the specified number of columns. |
static void |
printWords(java.util.Iterator<java.lang.String> words,
int maxColumn,
int maxWords,
java.io.PrintStream out)
Provides the same functionality as printWords(Iterator, int, int), except
that is allows a PrintStream to be specified, so that output
can be sent to a file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void addWords(java.io.Reader in,
java.util.List<java.lang.String> words)
throws java.io.IOException
in - InputStream to read fromwords - List to append to
java.io.IOException
java.lang.Exceptionpublic static java.util.Iterator<java.lang.String> characters(java.util.Iterator<java.lang.String> wordIterator)
wordIterator - Iterator over words
public static void printCharacters(java.util.Iterator<java.lang.String> characters,
int maxColumn,
int maxCharacters)
characters - iterator over characters to printmaxColumn - maximum number of characters per linemaxCharacters - maximum number of words
public static void printCharacters(java.util.Iterator<java.lang.String> characters,
int maxColumn,
int maxCharacters,
java.io.PrintStream out)
printCharacters(Iterator, int, int), except
that is allows a PrintStream to be specified, so that output
can be sent to a file.
public static void printWords(java.util.Iterator<java.lang.String> words,
int maxColumn,
int maxWords)
words - iterator over words to printmaxColumn - maximum number of characters per linemaxWords - maximum number of words
public static void printWords(java.util.Iterator<java.lang.String> words,
int maxColumn,
int maxWords,
java.io.PrintStream out)
printWords(Iterator, int, int), except
that is allows a PrintStream to be specified, so that output
can be sent to a file.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||