public class BasicFile extends java.lang.Object implements QuantTask
| Modifier and Type | Field and Description |
|---|---|
static int |
REPORT_INTERVAL
The default report interval.
|
| Constructor and Description |
|---|
BasicFile()
Construct the object, and set the defaults.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
appendSeparator(java.lang.StringBuilder line,
CSVFormat format)
Append a separator.
|
int |
getColumnCount() |
CSVFormat |
getFormat() |
java.io.File |
getInputFilename() |
java.lang.String[] |
getInputHeadings() |
int |
getPrecision() |
int |
getRecordCount() |
StatusReportable |
getReport() |
int |
getReportInterval() |
AnalystScript |
getScript() |
boolean |
isAnalyzed() |
boolean |
isExpectInputHeaders() |
boolean |
isProduceOutputHeaders() |
void |
performBasicCounts()
Perform a basic analyze of the file.
|
java.io.PrintWriter |
prepareOutputFile(java.io.File outputFile)
Prepare the output file, write headers if needed.
|
void |
readHeaders(ReadCSV csv)
Read the headers from a CSV file.
|
void |
reportDone(boolean isAnalyzing)
Report that we are done.
|
void |
reportDone(java.lang.String task)
Report that we are done.
|
void |
requestStop()
Request a stop.
|
void |
resetStatus()
Reset the reporting stats.
|
void |
setAnalyzed(boolean theAnalyzed)
Set to true, if the file has been analyzed.
|
void |
setColumnCount(int theColumnCount)
Set the column count.
|
void |
setExpectInputHeaders(boolean theExpectInputHeaders)
Set the flag to determine if we are expecting input headers.
|
void |
setInputFilename(java.io.File theInputFilename)
Set the input filename.
|
void |
setInputFormat(CSVFormat theInputFormat)
Set the input format.
|
void |
setInputHeadings(java.lang.String[] theInputHeadings)
Set the input headings.
|
void |
setPrecision(int thePrecision)
Set the precision to use.
|
void |
setProduceOutputHeaders(boolean theProduceOutputHeaders) |
void |
setRecordCount(int v)
Set the record count.
|
void |
setReport(StatusReportable theReport)
Set the status reporting object.
|
void |
setReportInterval(int theReportInterval)
Set the reporting interval.
|
void |
setScript(AnalystScript theScript) |
boolean |
shouldStop() |
java.lang.String |
toString() |
void |
updateStatus(boolean isAnalyzing)
Update the status.
|
void |
updateStatus(java.lang.String task)
Report the current status.
|
void |
validateAnalyzed()
Validate that the file has been analyzed.
|
void |
writeRow(java.io.PrintWriter tw,
LoadedRow row)
Write a row to the output file.
|
public static final int REPORT_INTERVAL
public static void appendSeparator(java.lang.StringBuilder line,
CSVFormat format)
line - The line to append to.format - The format to use.public int getColumnCount()
public java.io.File getInputFilename()
public CSVFormat getFormat()
public java.lang.String[] getInputHeadings()
public int getPrecision()
public int getRecordCount()
public StatusReportable getReport()
public int getReportInterval()
public boolean isAnalyzed()
public boolean isExpectInputHeaders()
public boolean isProduceOutputHeaders()
public void performBasicCounts()
public java.io.PrintWriter prepareOutputFile(java.io.File outputFile)
outputFile - The name of the output file.public void readHeaders(ReadCSV csv)
csv - The CSV file to read from.public void reportDone(boolean isAnalyzing)
isAnalyzing - True if we are analyzing.public void reportDone(java.lang.String task)
task - The message.public void requestStop()
requestStop in interface QuantTaskpublic void resetStatus()
public void setAnalyzed(boolean theAnalyzed)
theAnalyzed - True, if the file has been analyzed.public void setColumnCount(int theColumnCount)
theColumnCount - The new column count.public void setExpectInputHeaders(boolean theExpectInputHeaders)
theExpectInputHeaders - Are input headers expected?public void setInputFilename(java.io.File theInputFilename)
theInputFilename - The input filename.public void setInputFormat(CSVFormat theInputFormat)
theInputFormat - The new inputFormat format.public void setInputHeadings(java.lang.String[] theInputHeadings)
theInputHeadings - The new input headings.public void setPrecision(int thePrecision)
thePrecision - The precision to use.public void setProduceOutputHeaders(boolean theProduceOutputHeaders)
theProduceOutputHeaders - the produceOutputHeaders to setpublic void setRecordCount(int v)
v - The record count.public void setReport(StatusReportable theReport)
theReport - The status reporting object.public void setReportInterval(int theReportInterval)
theReportInterval - The new reporting interval.public boolean shouldStop()
shouldStop in interface QuantTaskpublic java.lang.String toString()
toString in class java.lang.Objectpublic void updateStatus(boolean isAnalyzing)
isAnalyzing - True if we are in the process of analyzing.public void updateStatus(java.lang.String task)
task - The string to report.public void validateAnalyzed()
public void writeRow(java.io.PrintWriter tw,
LoadedRow row)
tw - The output stream.row - The row to write out.public AnalystScript getScript()
public void setScript(AnalystScript theScript)
theScript - the script to set