stockDataRetrieval
Class DownloadManagerNASDAQ

java.lang.Object
  extended bystockDataRetrieval.DownloadManager
      extended bystockDataRetrieval.DownloadManagerNASDAQ

public class DownloadManagerNASDAQ
extends DownloadManager

Controls the behavior and variables for the NASDAQ information - inherits from the DownloadManager


Nested Class Summary
 
Nested classes inherited from class stockDataRetrieval.DownloadManager
 
Field Summary
private static java.lang.String tickerFile
          the file name where to save this list of tickers once they are parsed from the page
private static java.lang.String tickerSymbolPage
          the URL where the list of NASDAQ stocks resides
 
Fields inherited from class stockDataRetrieval.DownloadManager
 
Constructor Summary
DownloadManagerNASDAQ(int maxConnections)
          Constructor takes the user defined max concurrent connections to be made with Yahoo and calls the super class's constructor with necessary data
 
Method Summary
 void getStockTickers()
          Compiles a list of all stock ticker symbols from the given market.
 void getTickerAndCompany(java.lang.String targetURL, java.lang.String embeddedTickerCode, boolean nasdaqRound)
          Series of commands to download the web page specified, parse it for relevant information, and write the extracted data to a file (dependant on the market it is being harvested from).
private  void writeDataToFile(java.util.ArrayList data, boolean nasdaqState)
          Write all data gathered from the web page containing ticker/company information to the file "./Data/tickers.txt".
 
Methods inherited from class stockDataRetrieval.DownloadManager
createDirectory, createDirectoryStructure, getNewsStories, getStockHistoryFiles, getTickerAndCompany, main, writeDataToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tickerSymbolPage

private static java.lang.String tickerSymbolPage
the URL where the list of NASDAQ stocks resides


tickerFile

private static java.lang.String tickerFile
the file name where to save this list of tickers once they are parsed from the page

Constructor Detail

DownloadManagerNASDAQ

public DownloadManagerNASDAQ(int maxConnections)
Constructor takes the user defined max concurrent connections to be made with Yahoo and calls the super class's constructor with necessary data

Parameters:
maxConnections - the max concurent connections the user allows = a value of 0 will default to 5 concurrent connections at a time
Method Detail

getStockTickers

public void getStockTickers()
Compiles a list of all stock ticker symbols from the given market.

Delegates responsibility to functions to go to a specific website and repeatedly hit and parse pages containing company name and ticker symbols.

Specified by:
getStockTickers in class DownloadManager

getTickerAndCompany

public void getTickerAndCompany(java.lang.String targetURL,
                                java.lang.String embeddedTickerCode,
                                boolean nasdaqRound)
Series of commands to download the web page specified, parse it for relevant information, and write the extracted data to a file (dependant on the market it is being harvested from).

Parameters:
targetURL - the target URL for which to download all ticker/company names from
embeddedTickerCode - the pattern of the HTML that contains an individual ticker name

writeDataToFile

private void writeDataToFile(java.util.ArrayList data,
                             boolean nasdaqState)
Write all data gathered from the web page containing ticker/company information to the file "./Data/tickers.txt".

Parameters:
data - an containing entries of Ticker/CompanyName information in a String array of size [2]
nasdaqState - used only for the NASDAQ downloads. If true, the data is appended to the growing file. This is because all the NASDAQ stickers are found on 26 individual files - one for every letter.