|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mov.quote.FileQuoteSource
public class FileQuoteSource
Provides functionality to obtain stock quotes from files. This class implements the QuoteSource interface to allow users to directly use their stock quote files without creating a database. Example:
EODQuoteRange quoteRange = new EODQuoteRange("CBA");
EODQuoteBundle quoteBundle = new EODQuoteBundle(quoteRange);
try {
float = quoteBundle.getQuote("CBA", Quote.DAY_OPEN, 0);
}
catch(QuoteNotLoadedException e) {
//...
}
Quote,
EODQuoteRange,
EODQuoteBundle| Constructor Summary | |
|---|---|
FileQuoteSource(java.lang.String format,
java.util.List fileURLs)
Creates a new quote source using the list of files specified in the user preferences. |
|
| Method Summary | |
|---|---|
boolean |
containsDate(TradingDate date)
Returns whether the source contains any quotes for the given date. |
int |
getAdvanceDecline(TradingDate date)
Return the advance/decline for the given date. |
java.util.List |
getDates()
Return all the dates which we have quotes for (SLOW0. |
java.util.List |
getExchangeRates(Currency sourceCurrency,
Currency destinationCurrency)
Return all the stored exchange rates between the two currencies. |
TradingDate |
getFirstDate()
Return the earliest date we have any stock quotes for. |
TradingDate |
getLastDate()
Return the latest date we have any stock quotes for. |
Symbol |
getSymbol(java.lang.String partialCompanyName)
Returns the symbol associated with the given company. |
java.lang.String |
getSymbolName(Symbol symbol)
Returns the company name associated with the given symbol. |
java.net.URL |
getURLForDate(TradingDate date)
Returns the file URL that contains quotes for the given date. |
boolean |
isMarketIndex(Symbol symbol)
Is the given symbol a market index? |
boolean |
loadQuoteRange(EODQuoteRange quoteRange)
Load the given quote range into the quote cache. |
void |
shutdown()
Shutdown the quote source. |
boolean |
symbolExists(Symbol symbol)
Returns whether we have any quotes for the given symbol. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileQuoteSource(java.lang.String format,
java.util.List fileURLs)
format - The format filter to use to parse the quotesfileURLs - List of URL of files| Method Detail |
|---|
public java.lang.String getSymbolName(Symbol symbol)
getSymbolName in interface QuoteSourcesymbol - the stock symbol.
public Symbol getSymbol(java.lang.String partialCompanyName)
getSymbol in interface QuoteSourcepartialCompanyName - a partial company name.
public boolean symbolExists(Symbol symbol)
symbolExists in interface QuoteSourcesymbol - the symbol we are searching for.
public TradingDate getFirstDate()
getFirstDate in interface QuoteSourcepublic TradingDate getLastDate()
getLastDate in interface QuoteSourcepublic java.net.URL getURLForDate(TradingDate date)
date - the given date
public boolean containsDate(TradingDate date)
containsDate in interface QuoteSourcedate - the date
public java.util.List getDates()
getDates in interface QuoteSourcepublic boolean loadQuoteRange(EODQuoteRange quoteRange)
loadQuoteRange in interface QuoteSourcequoteRange - the range of quotes to load
TRUE if the operation suceededEODQuote,
EODQuoteCachepublic boolean isMarketIndex(Symbol symbol)
isMarketIndex in interface QuoteSourcesymbol - to test
public int getAdvanceDecline(TradingDate date)
throws MissingQuoteException
getAdvanceDecline in interface QuoteSourcedate - the date
throws - MissingQuoteException if the date wasn't in the source
MissingQuoteException
public java.util.List getExchangeRates(Currency sourceCurrency,
Currency destinationCurrency)
getExchangeRates in interface QuoteSourcesourceCurrency - the currency to convert fromdestinationCurrency - the currency to convert to
public void shutdown()
QuoteSource
shutdown in interface QuoteSource
|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||