public abstract static class Entity.Writer<E extends Entity> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected GTFSFeed |
feed |
protected long |
row
one-based to match reader.
|
protected String |
tableName |
protected com.csvreader.CsvWriter |
writer |
| Modifier | Constructor and Description |
|---|---|
protected |
Writer(GTFSFeed feed,
String tableName) |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertToGtfsTime(int secsSinceMidnight) |
void |
endRecord()
End a row.
|
protected abstract Iterator<E> |
iterator()
Get an iterator over objects of this type.
|
protected void |
writeDateField(LocalDate d)
Writes date as YYYYMMDD
|
protected void |
writeDoubleField(double val)
Write a double value, with precision 10^-7.
|
protected abstract void |
writeHeaders()
Write the CSV header.
|
protected void |
writeIntField(Integer val) |
protected abstract void |
writeOneRow(E obj)
Write one row of the CSV from the passed-in object.
|
protected void |
writeStringField(String str) |
void |
writeTable(ZipOutputStream zip) |
protected void |
writeTimeField(int secsSinceMidnight)
Take a time expressed in seconds since noon - 12h (midnight, usually) and write it in HH:MM:SS format.
|
protected void |
writeUrlField(URL obj) |
protected final GTFSFeed feed
protected final String tableName
protected com.csvreader.CsvWriter writer
protected long row
protected abstract void writeHeaders()
throws IOException
IOExceptionprotected abstract void writeOneRow(E obj) throws IOException
IOExceptionpublic void writeTable(ZipOutputStream zip) throws IOException
IOExceptionprotected void writeStringField(String str) throws IOException
IOExceptionprotected void writeUrlField(URL obj) throws IOException
IOExceptionprotected void writeDateField(LocalDate d) throws IOException
IOExceptionprotected void writeTimeField(int secsSinceMidnight)
throws IOException
IOExceptionpublic static String convertToGtfsTime(int secsSinceMidnight)
protected void writeIntField(Integer val) throws IOException
IOExceptionprotected void writeDoubleField(double val)
throws IOException
IOExceptionpublic void endRecord()
throws IOException
IOExceptionCopyright © 2019. All rights reserved.