Class 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 Detail

      • query

        protected final java.lang.String query
    • 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