Package de.gsi.financial.samples.service
Class SimpleOhlcvReplayDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<de.gsi.dataset.spi.financial.OhlcvDataSet>
-
- de.gsi.dataset.spi.financial.OhlcvDataSet
-
- de.gsi.financial.samples.service.SimpleOhlcvReplayDataSet
-
- All Implemented Interfaces:
de.gsi.dataset.DataSet,de.gsi.dataset.DataSetMetaData,de.gsi.dataset.event.EventSource,de.gsi.dataset.spi.financial.api.attrs.AttributeModelAware,de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItemAware,java.io.Serializable,java.lang.Iterable<de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItem>
public class SimpleOhlcvReplayDataSet extends de.gsi.dataset.spi.financial.OhlcvDataSet implements java.lang.Iterable<de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItem>, de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItemAware, de.gsi.dataset.spi.financial.api.attrs.AttributeModelAwareVery simple financial OHLC replay data set. The service is used just for simple testing of OHLC chart changes and performance.- Author:
- afischer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleOhlcvReplayDataSet.DataInput
-
Field Summary
Fields Modifier and Type Field Description protected IncrementalOhlcvConsolidationconsolidationprotected intmaxXIndexprotected DefaultOHLCVohlcvprotected java.util.Set<OhlcvChangeListener>ohlcvChangeListenersprotected java.util.concurrent.atomic.AtomicBooleanpausedprotected java.lang.ObjectpauseSemaphoreprotected java.util.concurrent.atomic.AtomicBooleanrunningprotected SCIDByNioscidprotected TickOhlcvDataProvidertickOhlcvDataProvider
-
Constructor Summary
Constructors Constructor Description SimpleOhlcvReplayDataSet(SimpleOhlcvReplayDataSet.DataInput dataInput, IntradayPeriod period, Interval<java.util.Calendar> timeRange, Interval<java.util.Calendar> tt, java.util.Calendar replayFrom, java.util.Map<java.lang.String,OhlcvConsolidationAddon[]> addons)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOhlcvChangeListener(OhlcvChangeListener ohlcvChangeListener)voidfillTestData(IntradayPeriod period, Interval<java.util.Calendar> timeRange, Interval<java.util.Calendar> tt, java.util.Calendar replayFrom, java.util.Map<java.lang.String,OhlcvConsolidationAddon[]> addons)protected voidfireOhlcvTickEvent(de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItem ohlcvItem)protected java.lang.RunnablegetDataUpdateTask()SimpleOhlcvReplayDataSet.DataInputgetInputSource()java.lang.StringgetResource()voidpauseResume()pause/resume play back of the data source via the sound cardvoidsetInputSource(SimpleOhlcvReplayDataSet.DataInput inputSource)voidsetUpdatePeriod(double updatePeriod)Update replay intervalvoidstart()starts play back of the data source via the sound cardvoidstep()voidstop()stops and resets play back of the data source via the sound cardprotected voidtick()-
Methods inherited from class de.gsi.dataset.spi.financial.OhlcvDataSet
get, getAddon, getAddonOrCreate, getData, getDataCount, getItem, getLastItem, getXIndex, isCategoryBased, iterator, set, setCategoryBased, setData
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, binarySearch, clearMetaInfo, copyAxisDescription, copyDataLabelsAndStyles, copyMetaData, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getThis, getValue, getValues, getWarningList, hashCode, isVisible, lock, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, setVisible, toString, updateEventListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.spi.financial.api.attrs.AttributeModelAware
getAddon, getAddonOrCreate
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener
-
-
-
-
Field Detail
-
ohlcv
protected transient DefaultOHLCV ohlcv
-
running
protected java.util.concurrent.atomic.AtomicBoolean running
-
paused
protected java.util.concurrent.atomic.AtomicBoolean paused
-
pauseSemaphore
protected final transient java.lang.Object pauseSemaphore
-
scid
protected transient SCIDByNio scid
-
tickOhlcvDataProvider
protected transient TickOhlcvDataProvider tickOhlcvDataProvider
-
consolidation
protected transient IncrementalOhlcvConsolidation consolidation
-
ohlcvChangeListeners
protected transient java.util.Set<OhlcvChangeListener> ohlcvChangeListeners
-
maxXIndex
protected int maxXIndex
-
-
Constructor Detail
-
SimpleOhlcvReplayDataSet
public SimpleOhlcvReplayDataSet(SimpleOhlcvReplayDataSet.DataInput dataInput, IntradayPeriod period, Interval<java.util.Calendar> timeRange, Interval<java.util.Calendar> tt, java.util.Calendar replayFrom, java.util.Map<java.lang.String,OhlcvConsolidationAddon[]> addons)
-
-
Method Detail
-
addOhlcvChangeListener
public void addOhlcvChangeListener(OhlcvChangeListener ohlcvChangeListener)
-
fillTestData
public void fillTestData(IntradayPeriod period, Interval<java.util.Calendar> timeRange, Interval<java.util.Calendar> tt, java.util.Calendar replayFrom, java.util.Map<java.lang.String,OhlcvConsolidationAddon[]> addons)
-
tick
protected void tick() throws java.lang.Exception- Throws:
java.lang.Exception
-
fireOhlcvTickEvent
protected void fireOhlcvTickEvent(de.gsi.dataset.spi.financial.api.ohlcv.IOhlcvItem ohlcvItem) throws java.lang.Exception- Throws:
java.lang.Exception
-
getResource
public java.lang.String getResource()
-
getInputSource
public SimpleOhlcvReplayDataSet.DataInput getInputSource()
-
setInputSource
public void setInputSource(SimpleOhlcvReplayDataSet.DataInput inputSource)
-
pauseResume
public void pauseResume()
pause/resume play back of the data source via the sound card
-
setUpdatePeriod
public void setUpdatePeriod(double updatePeriod)
Update replay interval- Parameters:
updatePeriod- replay multiple 1.0-N
-
start
public void start()
starts play back of the data source via the sound card
-
step
public void step()
-
stop
public void stop()
stops and resets play back of the data source via the sound card
-
getDataUpdateTask
protected java.lang.Runnable getDataUpdateTask()
-
-