CryptoBase, CryptoBaseExchange, HistoricalBaseHistoricalDaily, HistoricalHourly, HistoricalMinutepublic abstract class HistoricalData extends java.lang.Object implements CryptoBaseExchange, HistoricalBase
TimestampedData| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
dataToString() |
returns a string representation of the historical data retrieved from the
Historical OHLCV end point.
|
static HistoricalDaily |
generateHistoDaily(java.lang.String currencyTo,
java.lang.String currencyFrom,
ExchangeStreamer.exchanges exchange) |
gets a new instance of HistoricalDaily with the following parameters
|
static HistoricalHourly |
generateHistoHourly(java.lang.String currencyTo,
java.lang.String currencyFrom,
ExchangeStreamer.exchanges exchange) |
gets a new instance of HistoricalHourly with the following parameters
|
static HistoricalMinute |
generateHistoMinute(java.lang.String currencyTo,
java.lang.String currencyFrom,
ExchangeStreamer.exchanges exchange) |
gets a new instance of HistoricalMinute with the following parameters
|
int |
getAggregate() |
gets the aggregate parameter this object uses for the CryptoCompare API
|
ConversionType |
getConversionType() |
gets the ConversionType for this object
|
java.lang.String |
getCurrencyFrom() |
gets the fsym(s) parameter this object uses for the CryptoCompare API
|
java.lang.String |
getCurrencyTo() |
gets the tsym(s) parameter this object uses for the CryptoCompare API
|
abstract TimestampedData |
getDataAtTime(long timestamp) |
gets the TimestampedData with unix timestamp equal to unixTimestamp.
If the unixTimestamp is in between two unix timestamps then the latter TimestampedData is returned. |
java.util.stream.Stream<TimestampedData> |
getDataStream() |
streams TimestampedData from this Historical object
|
ExchangeStreamer.exchanges |
getExchange() |
gets the e parameter this object uses for the CryptoCompare API
|
long |
getLastUnixTimestamp() |
gets the toTs parameter this object uses for the CryptoCompare API
|
int |
getLimit() |
gets the limit parameter this object uses for the CryptoCompare API
|
java.lang.String |
getResponse() |
|
long |
getTimeFrom() |
|
long |
getTimeTo() |
|
float |
getType() |
|
java.net.URL |
getURL() |
gets the https://min-api.cryptocompare.com/data/histo end point url with
parameters currencyTo, currencyFrom, exchange, lastUnixTimestamp, limit,
aggregate, and apiKey (if any)
|
boolean |
isAggregated() |
|
boolean |
isFirstValueInArray() |
|
void |
setAggregate(int aggregate) |
sets the aggregate parameter this object uses for the CryptoCompare API
|
void |
setCurrencyFrom(java.lang.String currencyFrom) |
sets the fsym(s) parameter this object uses for the CryptoCompare API
|
void |
setCurrencyTo(java.lang.String currencyTo) |
sets the tsym(s) parameter this object uses for the CryptoCompare API
|
void |
setExchange(ExchangeStreamer.exchanges exchange) |
sets the e parameter this object uses for the CryptoCompare API
|
void |
setLastUnixTimestamp(long time) |
sets the toTs parameter this object uses for the CryptoCompare API
|
void |
setLimit(int limit) |
sets the limit parameter this object uses for the CryptoCompare API
|
void |
update() |
updates url with parameters, then connects and updates this objects fields
with the returned json.
|
public static HistoricalDaily generateHistoDaily(java.lang.String currencyTo, java.lang.String currencyFrom, ExchangeStreamer.exchanges exchange)
currencyTo - currency symbol to convert tocurrencyFrom - currency symbol to convert fromexchange - exchange to get data frompublic static HistoricalHourly generateHistoHourly(java.lang.String currencyTo, java.lang.String currencyFrom, ExchangeStreamer.exchanges exchange)
currencyTo - currency symbol to convert tocurrencyFrom - currency symbol to convert fromexchange - exchange to get data frompublic static HistoricalMinute generateHistoMinute(java.lang.String currencyTo, java.lang.String currencyFrom, ExchangeStreamer.exchanges exchange)
currencyTo - currency symbol to convert tocurrencyFrom - currency symbol to convert fromexchange - exchange to get data frompublic long getLastUnixTimestamp()
HistoricalBasegetLastUnixTimestamp in interface HistoricalBasepublic void setLastUnixTimestamp(long time)
HistoricalBasesetLastUnixTimestamp in interface HistoricalBasetime - the last unix timestamp to get data forpublic int getAggregate()
HistoricalBasegetAggregate in interface HistoricalBasepublic void setAggregate(int aggregate)
HistoricalBasesetAggregate in interface HistoricalBaseaggregate - time period to aggregate the data overpublic int getLimit()
HistoricalBasegetLimit in interface HistoricalBasepublic void setLimit(int limit)
HistoricalBasesetLimit in interface HistoricalBaselimit - The number of TimestampedData to returnpublic ExchangeStreamer.exchanges getExchange()
CryptoBaseExchangegetExchange in interface CryptoBaseExchangepublic void setExchange(ExchangeStreamer.exchanges exchange)
CryptoBaseExchangesetExchange in interface CryptoBaseExchangeexchange - exchange to get data frompublic java.lang.String getCurrencyFrom()
CryptoBasegetCurrencyFrom in interface CryptoBasepublic void setCurrencyFrom(java.lang.String currencyFrom)
CryptoBasesetCurrencyFrom in interface CryptoBasecurrencyFrom - currency symbol to convert frompublic java.lang.String getCurrencyTo()
CryptoBasegetCurrencyTo in interface CryptoBasepublic void setCurrencyTo(java.lang.String currencyTo)
CryptoBasesetCurrencyTo in interface CryptoBasecurrencyTo - currency symbol to convert topublic java.net.URL getURL()
getURL in interface CryptoBasepublic java.lang.String getResponse()
getResponse in interface HistoricalBasepublic float getType()
getType in interface HistoricalBasepublic boolean isAggregated()
isAggregated in interface HistoricalBasepublic long getTimeTo()
getTimeTo in interface HistoricalBasepublic long getTimeFrom()
getTimeFrom in interface HistoricalBasepublic boolean isFirstValueInArray()
isFirstValueInArray in interface HistoricalBasepublic ConversionType getConversionType()
HistoricalBasegetConversionType in interface HistoricalBaseConversionTypepublic java.util.stream.Stream<TimestampedData> getDataStream()
HistoricalBasegetDataStream in interface HistoricalBaseTimestampedDatapublic abstract TimestampedData getDataAtTime(long timestamp) throws TimestampOutOfBoundsException
HistoricalBasegetDataAtTime in interface HistoricalBasetimestamp - unix timestamp of TimestampedData to getTimestampOutOfBoundsExceptionTimestampedDatapublic void update()
throws InvalidArgumentException
update in interface CryptoBaseInvalidArgumentExceptionpublic java.lang.String dataToString()
dataToString in interface CryptoBaseTimestampedData.datatoString(),
ConversionType.datatoString()