Package yahoofinance.quotes.csv
Class QuotesRequest<T>
- java.lang.Object
-
- yahoofinance.quotes.csv.QuotesRequest<T>
-
- Type Parameters:
T- Type of object that can contain the retrieved information from a quotes request
- Direct Known Subclasses:
FxQuotesRequest,StockQuotesRequest
public abstract class QuotesRequest<T> extends java.lang.Object- Author:
- Stijn Strickx
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<QuotesProperty>propertiesprotected java.lang.Stringquery
-
Constructor Summary
Constructors Constructor Description QuotesRequest(java.lang.String query, java.util.List<QuotesProperty> properties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<QuotesProperty>getProperties()java.lang.StringgetQuery()java.util.List<T>getResult()Sends the request to Yahoo Finance and parses the resultTgetSingleResult()protected abstract TparseCSVLine(java.lang.String line)voidsetProperties(java.util.List<QuotesProperty> properties)
-
-
-
Field Detail
-
query
protected final java.lang.String query
-
properties
protected java.util.List<QuotesProperty> properties
-
-
Constructor Detail
-
QuotesRequest
public QuotesRequest(java.lang.String query, java.util.List<QuotesProperty> properties)
-
-
Method Detail
-
getQuery
public java.lang.String getQuery()
-
getProperties
public java.util.List<QuotesProperty> getProperties()
-
setProperties
public void setProperties(java.util.List<QuotesProperty> properties)
-
parseCSVLine
protected abstract T parseCSVLine(java.lang.String line)
-
getSingleResult
public T getSingleResult() throws java.io.IOException
- Throws:
java.io.IOException
-
getResult
public java.util.List<T> getResult() throws java.io.IOException
Sends the request to Yahoo Finance and parses the result- Returns:
- List of parsed objects resulting from the Yahoo Finance request
- Throws:
java.io.IOException- when there's a connection problem or the request is incorrect
-
-