com.fisincorporated.stockinfoserver
Class StockDataSlicer

java.lang.Object
  extended bycom.fisincorporated.stockinfoserver.StockDataSlicer

public class StockDataSlicer
extends java.lang.Object

This object is to create a set of stock data files for use as input to Joone or other systems To Do Pass in defaults rather than hard code

Author:
Eric Foertsch

Constructor Summary
StockDataSlicer()
           
 
Method Summary
 void checkDirectory(java.lang.String directory)
           
 void createSetSummaryExcel(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook, org.apache.poi.hssf.usermodel.HSSFSheet worksheet, int workSheetRowNumber)
           
 void createSetSummaryText(java.io.PrintWriter printer)
           
 java.io.PrintWriter createTextFile(int i)
           
 org.apache.poi.hssf.usermodel.HSSFWorkbook createWorkbook()
           
 org.apache.poi.hssf.usermodel.HSSFSheet createWorkSheet(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook, java.lang.String worksheetName)
           
 org.apache.poi.hssf.usermodel.HSSFRow createWorkSheetRow(org.apache.poi.hssf.usermodel.HSSFSheet worksheet, int workSheetRowNumber)
           
 boolean fetchStockData()
           
 java.lang.String getCompletionMessage()
           
 java.lang.String getDataValueSeparator()
           
 java.lang.String getDirectory()
           
 java.lang.String getEndDate()
           
 java.lang.String getFileNamePrefix()
           
 int getPredictDaysForward()
           
 int getSampleSize()
           
 java.lang.String getStartDate()
           
 Stock getStock()
           
 java.lang.String getSymbol()
           
 java.lang.String getWorksheetPrefix()
           
 void initialize()
           
static void main(java.lang.String[] args)
           
 void removeExistingCells(org.apache.poi.hssf.usermodel.HSSFRow row, int numberColumns)
           
 void resetMaxMin()
           
 void setCellValue(org.apache.poi.hssf.usermodel.HSSFRow row, int column, double value)
           
 void setCellValue(org.apache.poi.hssf.usermodel.HSSFRow row, int column, java.lang.String value)
           
 void setDataValueSeparator(java.lang.String dataValueSeparator)
           
 void setDirectory(java.lang.String directory)
           
 void setEndDate(java.lang.String endDate)
           
 void setFileNamePrefix(java.lang.String fileNamePrefix)
           
 void setMaxMinValues(int rowNumber, java.lang.String stockDate, float openPrice, float highPrice, float lowPrice, float closePrice, long volume, float futurePrice)
           
 void setPredictDaysForward(int predictDaysForward)
           
 void setPredictDaysForward(java.lang.String predictDaysForward)
           
 void setRowValues(org.apache.poi.hssf.usermodel.HSSFRow row, java.lang.String stockDate, float openPrice, float highPrice, float lowPrice, float closePrice, long volume, float futurePrice)
           
 void setSampleSize(int sampleSize)
           
 void setSampleSize(java.lang.String sampleSize)
           
 void setStartDate(java.lang.String startDate)
           
 void setStock(Stock stock)
           
 void setSymbol(java.lang.String symbol)
           
 void setWorksheetPrefix(java.lang.String worksheetPrefix)
           
 boolean writeExcelData()
          Writes the stock info to Excel workbook.
 boolean writeTextData()
           
 void writeWorkbookToFile(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook, java.lang.String directory, java.lang.String symbol)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StockDataSlicer

public StockDataSlicer()
Method Detail

initialize

public void initialize()

setSymbol

public void setSymbol(java.lang.String symbol)
               throws java.lang.Exception
Throws:
java.lang.Exception

getSymbol

public java.lang.String getSymbol()
Returns:
Returns the symbol.

setSampleSize

public void setSampleSize(int sampleSize)

setSampleSize

public void setSampleSize(java.lang.String sampleSize)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getSampleSize

public int getSampleSize()
Returns:
Returns the sampleSize.

setStartDate

public void setStartDate(java.lang.String startDate)
                  throws java.lang.Exception
Throws:
java.lang.Exception

getStartDate

public java.lang.String getStartDate()
Returns:
Returns the startDate.

setEndDate

public void setEndDate(java.lang.String endDate)
                throws java.lang.Exception
Throws:
java.lang.Exception

getEndDate

public java.lang.String getEndDate()
Returns:
Returns the endDate.

setPredictDaysForward

public void setPredictDaysForward(int predictDaysForward)

setPredictDaysForward

public void setPredictDaysForward(java.lang.String predictDaysForward)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getPredictDaysForward

public int getPredictDaysForward()
Returns:
Returns the predictDaysForward.

setFileNamePrefix

public void setFileNamePrefix(java.lang.String fileNamePrefix)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getFileNamePrefix

public java.lang.String getFileNamePrefix()
Returns:
Returns the fileNamePrefix.

getDataValueSeparator

public java.lang.String getDataValueSeparator()
Returns:
Returns the dataValueSeparator.

setDataValueSeparator

public void setDataValueSeparator(java.lang.String dataValueSeparator)
                           throws java.lang.Exception
Parameters:
dataValueSeparator - The dataValueSeparator to set.
Throws:
java.lang.Exception

fetchStockData

public boolean fetchStockData()
                       throws java.lang.Exception
Throws:
java.lang.Exception

writeTextData

public boolean writeTextData()
                      throws java.lang.Exception
Throws:
java.lang.Exception

createTextFile

public java.io.PrintWriter createTextFile(int i)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

checkDirectory

public void checkDirectory(java.lang.String directory)
                    throws java.lang.Exception
Throws:
java.lang.Exception

createSetSummaryText

public void createSetSummaryText(java.io.PrintWriter printer)

writeExcelData

public boolean writeExcelData()
                       throws java.lang.Exception
Writes the stock info to Excel workbook. A number of worksheets may be created to hold the segmented data

Throws:
java.lang.Exception

createWorkbook

public org.apache.poi.hssf.usermodel.HSSFWorkbook createWorkbook()
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

createWorkSheet

public org.apache.poi.hssf.usermodel.HSSFSheet createWorkSheet(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook,
                                                               java.lang.String worksheetName)

createWorkSheetRow

public org.apache.poi.hssf.usermodel.HSSFRow createWorkSheetRow(org.apache.poi.hssf.usermodel.HSSFSheet worksheet,
                                                                int workSheetRowNumber)

removeExistingCells

public void removeExistingCells(org.apache.poi.hssf.usermodel.HSSFRow row,
                                int numberColumns)

setRowValues

public void setRowValues(org.apache.poi.hssf.usermodel.HSSFRow row,
                         java.lang.String stockDate,
                         float openPrice,
                         float highPrice,
                         float lowPrice,
                         float closePrice,
                         long volume,
                         float futurePrice)

writeWorkbookToFile

public void writeWorkbookToFile(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook,
                                java.lang.String directory,
                                java.lang.String symbol)
                         throws java.lang.Exception
Throws:
java.lang.Exception

setCellValue

public void setCellValue(org.apache.poi.hssf.usermodel.HSSFRow row,
                         int column,
                         double value)

setCellValue

public void setCellValue(org.apache.poi.hssf.usermodel.HSSFRow row,
                         int column,
                         java.lang.String value)

createSetSummaryExcel

public void createSetSummaryExcel(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook,
                                  org.apache.poi.hssf.usermodel.HSSFSheet worksheet,
                                  int workSheetRowNumber)

setMaxMinValues

public void setMaxMinValues(int rowNumber,
                            java.lang.String stockDate,
                            float openPrice,
                            float highPrice,
                            float lowPrice,
                            float closePrice,
                            long volume,
                            float futurePrice)

resetMaxMin

public void resetMaxMin()

main

public static void main(java.lang.String[] args)

getCompletionMessage

public java.lang.String getCompletionMessage()
Returns:
Returns the completionMessage.

getDirectory

public java.lang.String getDirectory()
Returns:
Returns the directory.

setDirectory

public void setDirectory(java.lang.String directory)
Parameters:
directory - The directory to set.

getStock

public Stock getStock()
Returns:
Returns the stock.

setStock

public void setStock(Stock stock)
Parameters:
stock - The stock to set.

getWorksheetPrefix

public java.lang.String getWorksheetPrefix()
Returns:
Returns the worksheetPrefix.

setWorksheetPrefix

public void setWorksheetPrefix(java.lang.String worksheetPrefix)
Parameters:
worksheetPrefix - The worksheetPrefix to set.