randoop.util
Class StringLineIterator
Object
StringLineIterator
public class StringLineIterator
extends Object
Given a string consisting of words separated by white space, lets the
user ask for the words as lines of text of a desired length, until there
are no more words.
Method Summary
boolean |
hasMoreWords()
True if there are more words remaining. |
String |
nextLine(int length)
Returns a line of words, ensuring that the length of the line
is no greater than the given length. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringLineIterator
public StringLineIterator(String words)
hasMoreWords
public boolean hasMoreWords()
- True if there are more words remaining.
nextLine
public String nextLine(int length)
- Returns a line of words, ensuring that the length of the line
is no greater than the given length. If such a line is not possible,
returns an empty String.
Note that if length is always too small for the iterator to make
progress by returning non-empty lines, the iterator will not
terminate.