stockDataRetrieval
Class NewsDownloadEngine

java.lang.Object
  extended bystockDataRetrieval.NewsDownloadEngine

public class NewsDownloadEngine
extends java.lang.Object

Class contians functions support the fetching of news stories from Yahoo's web page


Constructor Summary
NewsDownloadEngine()
           
 
Method Summary
static java.lang.String constructBaseURL(java.lang.String ticker)
          Creates the starting URL to begin downloading the news stories
private static java.util.GregorianCalendar setTomorrowDate()
          Gets a calendar object that is set to tomorrow's date.
static boolean writeStoriesToFile(java.lang.String ticker, java.util.ArrayList downloadedStories)
          Writes the compiled list of stories to a file named "TICKER_news.txt" under the Data/NewsFiles directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewsDownloadEngine

public NewsDownloadEngine()
Method Detail

setTomorrowDate

private static java.util.GregorianCalendar setTomorrowDate()
Gets a calendar object that is set to tomorrow's date.

Used to get tomorrows date so that when fetching all news stories, the lastest stories are fetched.


constructBaseURL

public static java.lang.String constructBaseURL(java.lang.String ticker)
Creates the starting URL to begin downloading the news stories

Parameters:
ticker - the name of the stock to begin getting news stories from
Returns:
the URL of the page to begin fetching stories from

writeStoriesToFile

public static boolean writeStoriesToFile(java.lang.String ticker,
                                         java.util.ArrayList downloadedStories)
Writes the compiled list of stories to a file named "TICKER_news.txt" under the Data/NewsFiles directory

Parameters:
ticker - the ticker of news stories being written to the file
downloadedStories - the list NewsObject stories to be written to the file
Returns:
true if the stories were successfully written and false otherwise