Package randoop.util
Class RecordListReader
- java.lang.Object
-
- randoop.util.RecordListReader
-
public class RecordListReader extends Object
Reads a list of records from a text file, where a record is partially specified by the client of this class.A record is a sequence of lines, where the first line is the string "
START <recordtype>
" and the last line is the string "END <recordtype>
" where<recordtype>
is specified by the client. For example:START person ... arbitrary text ... ... more arbitrary text ... END person
Any lines within and between records, that are only whitespace or start with "#", are skipped.This class's built-in functionality extracts records from a file. It then parses and processes each record, using the RecordProcessor provided by the client. .
-
-
Field Summary
Fields Modifier and Type Field Description private String
endMarker
The value of endMarker is "END recordType"private RecordProcessor
processor
The object in charge of doing whatever is to be done with the record.private String
startMarker
The value of startMarker is "START recordType"
-
Constructor Summary
Constructors Constructor Description RecordListReader(String recordType, RecordProcessor proc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static String
nextNWCLine(BufferedReader reader)
void
parse(BufferedReader reader)
void
parse(String inFile)
void
parse(Path inFile)
private List<String>
readOneRecord(BufferedReader reader)
-
-
-
Field Detail
-
startMarker
private final String startMarker
The value of startMarker is "START recordType"
-
endMarker
private final String endMarker
The value of endMarker is "END recordType"
-
processor
private final RecordProcessor processor
The object in charge of doing whatever is to be done with the record.
-
-
Constructor Detail
-
RecordListReader
public RecordListReader(String recordType, RecordProcessor proc)
-
-
Method Detail
-
parse
public void parse(String inFile)
-
parse
public void parse(Path inFile)
-
parse
public void parse(BufferedReader reader)
-
readOneRecord
private List<String> readOneRecord(BufferedReader reader) throws IOException
- Throws:
IOException
-
nextNWCLine
private static String nextNWCLine(BufferedReader reader) throws IOException
- Throws:
IOException
-
-