- java.lang.Object
-
- org.ojalgo.data.domain.finance.series.DataSource
-
- All Implemented Interfaces:
FinanceData<DatePrice>
public final class DataSource extends java.lang.Object implements FinanceData<DatePrice>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataSource.Coordinated
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.UnaryOperator<java.time.LocalDate>FRIDAY_OF_WEEKMove the date forward, if necessary, to a Friday.static java.util.function.UnaryOperator<java.time.LocalDate>LAST_DAY_OF_MONTHMove the date forward, if necessary, to the last day of the month.static java.util.function.UnaryOperator<java.time.LocalDate>LAST_DAY_OF_YEARMove the date forward, if necessary, to the last day of the year.private DataFetchermyFetcherprivate BasicParser<? extends DatePrice>myParser
-
Constructor Summary
Constructors Constructor Description DataSource(DataFetcher fetcher, BasicParser<? extends DatePrice> parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DataSource.Coordinatedcoordinated()static DataSource.Coordinatedcoordinated(CalendarDateUnit resolution)booleanequals(java.lang.Object obj)CalendarDateSeries<java.lang.Double>getCalendarDateSeries()CalendarDateSeries<java.lang.Double>getCalendarDateSeries(java.time.LocalTime time, java.time.ZoneId zoneId)CalendarDateSeries<java.lang.Double>getCalendarDateSeries(CalendarDateUnit resolution)CalendarDateSeries<java.lang.Double>getCalendarDateSeries(CalendarDateUnit resolution, java.time.LocalTime time, java.time.ZoneId zoneId)KeyValue<java.lang.String,java.util.List<DatePrice>>getHistoricalData()java.util.List<DatePrice>getHistoricalPrices()BasicSeries<java.time.LocalDate,PrimitiveNumber>getLocalDateSeries()private BasicSeries<java.time.LocalDate,PrimitiveNumber>getLocalDateSeries(java.util.List<DatePrice> historicalPrices, CalendarDateUnit resolution)BasicSeries<java.time.LocalDate,PrimitiveNumber>getLocalDateSeries(DenseArray.Factory<java.lang.Double,?> denseArrayFactory)BasicSeries<java.time.LocalDate,PrimitiveNumber>getLocalDateSeries(CalendarDateUnit resolution)BasicSeries<java.time.LocalDate,PrimitiveNumber>getLocalDateSeries(CalendarDateUnit resolution, DenseArray.Factory<java.lang.Double,?> denseArrayFactory)BasicSeries<java.time.LocalDate,PrimitiveNumber>getPriceSeries()java.lang.StringgetSymbol()inthashCode()static DataSourcenewAlphaVantage(java.lang.String symbol, CalendarDateUnit resolution, java.lang.String apiKey)Deprecated.static DataSourcenewAlphaVantage(java.lang.String symbol, CalendarDateUnit resolution, java.lang.String apiKey, boolean fullOutputSize)Deprecated.static <T extends DatePrice>
DataSourcenewFileReader(java.io.File file, BasicParser<T> parser)static <T extends DatePrice>
DataSourcenewFileReader(java.io.File file, BasicParser<T> parser, CalendarDateUnit resolution)static DataSourcenewIEXTrading(java.lang.String symbol)Deprecated.static DataSourcenewYahoo(YahooSession session, java.lang.String symbol, CalendarDateUnit resolution)Deprecated.
-
-
-
Field Detail
-
FRIDAY_OF_WEEK
public static final java.util.function.UnaryOperator<java.time.LocalDate> FRIDAY_OF_WEEK
Move the date forward, if necessary, to a Friday.
-
LAST_DAY_OF_MONTH
public static final java.util.function.UnaryOperator<java.time.LocalDate> LAST_DAY_OF_MONTH
Move the date forward, if necessary, to the last day of the month.
-
LAST_DAY_OF_YEAR
public static final java.util.function.UnaryOperator<java.time.LocalDate> LAST_DAY_OF_YEAR
Move the date forward, if necessary, to the last day of the year.
-
myFetcher
private final DataFetcher myFetcher
-
myParser
private final BasicParser<? extends DatePrice> myParser
-
-
Constructor Detail
-
DataSource
DataSource(DataFetcher fetcher, BasicParser<? extends DatePrice> parser)
-
-
Method Detail
-
coordinated
public static DataSource.Coordinated coordinated()
-
coordinated
public static DataSource.Coordinated coordinated(CalendarDateUnit resolution)
-
newAlphaVantage
@Deprecated public static DataSource newAlphaVantage(java.lang.String symbol, CalendarDateUnit resolution, java.lang.String apiKey)
Deprecated.All data downloaders/fetchers are deprecated. They will be removed in a future release, and most likely they're already broken.
-
newAlphaVantage
@Deprecated public static DataSource newAlphaVantage(java.lang.String symbol, CalendarDateUnit resolution, java.lang.String apiKey, boolean fullOutputSize)
Deprecated.All data downloaders/fetchers are deprecated. They will be removed in a future release, and most likely they're already broken.
-
newFileReader
public static <T extends DatePrice> DataSource newFileReader(java.io.File file, BasicParser<T> parser)
-
newFileReader
public static <T extends DatePrice> DataSource newFileReader(java.io.File file, BasicParser<T> parser, CalendarDateUnit resolution)
-
newIEXTrading
@Deprecated public static DataSource newIEXTrading(java.lang.String symbol)
Deprecated.All data downloaders/fetchers are deprecated. They will be removed in a future release, and most likely they're already broken.
-
newYahoo
@Deprecated public static DataSource newYahoo(YahooSession session, java.lang.String symbol, CalendarDateUnit resolution)
Deprecated.All data downloaders/fetchers are deprecated. They will be removed in a future release, and most likely they're already broken.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getCalendarDateSeries
public CalendarDateSeries<java.lang.Double> getCalendarDateSeries()
-
getCalendarDateSeries
public CalendarDateSeries<java.lang.Double> getCalendarDateSeries(CalendarDateUnit resolution)
-
getCalendarDateSeries
public CalendarDateSeries<java.lang.Double> getCalendarDateSeries(CalendarDateUnit resolution, java.time.LocalTime time, java.time.ZoneId zoneId)
-
getCalendarDateSeries
public CalendarDateSeries<java.lang.Double> getCalendarDateSeries(java.time.LocalTime time, java.time.ZoneId zoneId)
-
getHistoricalData
public KeyValue<java.lang.String,java.util.List<DatePrice>> getHistoricalData()
- Specified by:
getHistoricalDatain interfaceFinanceData<DatePrice>
-
getHistoricalPrices
public java.util.List<DatePrice> getHistoricalPrices()
- Specified by:
getHistoricalPricesin interfaceFinanceData<DatePrice>
-
getLocalDateSeries
public BasicSeries<java.time.LocalDate,PrimitiveNumber> getLocalDateSeries()
-
getLocalDateSeries
public BasicSeries<java.time.LocalDate,PrimitiveNumber> getLocalDateSeries(CalendarDateUnit resolution)
-
getLocalDateSeries
public BasicSeries<java.time.LocalDate,PrimitiveNumber> getLocalDateSeries(CalendarDateUnit resolution, DenseArray.Factory<java.lang.Double,?> denseArrayFactory)
-
getLocalDateSeries
public BasicSeries<java.time.LocalDate,PrimitiveNumber> getLocalDateSeries(DenseArray.Factory<java.lang.Double,?> denseArrayFactory)
-
getPriceSeries
public BasicSeries<java.time.LocalDate,PrimitiveNumber> getPriceSeries()
- Specified by:
getPriceSeriesin interfaceFinanceData<DatePrice>
-
getSymbol
public java.lang.String getSymbol()
- Specified by:
getSymbolin interfaceFinanceData<DatePrice>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getLocalDateSeries
private BasicSeries<java.time.LocalDate,PrimitiveNumber> getLocalDateSeries(java.util.List<DatePrice> historicalPrices, CalendarDateUnit resolution)
-
-