@CodeReview(reviewer="Jonathan McClain", date="2006-05-22", changesNeeded=true, comments="Changes marked by triple slash", response=@CodeReviewResponse(respondent="Justin Basilico",date="2006-07-20",moreChangesNeeded=false,comments="Changes from J.T.\'s code review")) public class VectorReader extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT_LINE_PREFIX
The start of a comment line has the "#" string at the beginning.
|
Constructor and Description |
---|
VectorReader(java.io.Reader reader)
Creates a new instance of VectorReader
|
VectorReader(ReaderTokenizer tokenizer)
Creates a new instance of VectorReader
|
Modifier and Type | Method and Description |
---|---|
protected ReaderTokenizer |
getTokenizer()
Getter for tokenizer
|
static Vector |
parseVector(java.util.Collection<java.lang.String> tokens)
Parses a
Vector from the given list of element tokens. |
Vector |
read()
Reads a Vector off of the next line in the file
|
java.util.List<Vector> |
readCollection(boolean mustBeSameSize)
Reads a collection of Vectors from the Reader
|
protected void |
setTokenizer(ReaderTokenizer tokenizer)
Setter for tokenizer
|
public static final java.lang.String COMMENT_LINE_PREFIX
public VectorReader(java.io.Reader reader)
reader
- Java-based reader from which to pull the Vectorpublic VectorReader(ReaderTokenizer tokenizer)
tokenizer
- Parses the input stream and pulls out tokenspublic Vector read() throws java.io.IOException
java.io.IOException
- on a bad readLine on the BufferedReaderpublic static Vector parseVector(java.util.Collection<java.lang.String> tokens)
Vector
from the given list of element tokens.tokens
- The collection of element tokens.Vector
created from the given tokens.public java.util.List<Vector> readCollection(boolean mustBeSameSize) throws java.io.IOException
mustBeSameSize
- true if the Vectors must be same size,
false allows any sized Vectors in the Listjava.io.IOException
- if the Reader isn't valid or doesn't contain
a Vectorprotected ReaderTokenizer getTokenizer()
protected void setTokenizer(ReaderTokenizer tokenizer)
tokenizer
- Parses the input stream and pulls out tokens