Package de.gsi.dataset.spi.financial
Class OhlcvDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<OhlcvDataSet>
-
- de.gsi.dataset.spi.financial.OhlcvDataSet
-
- All Implemented Interfaces:
DataSet,DataSetMetaData,EventSource,AttributeModelAware,IOhlcvItemAware,java.io.Serializable,java.lang.Iterable<IOhlcvItem>
public class OhlcvDataSet extends AbstractDataSet<OhlcvDataSet> implements java.lang.Iterable<IOhlcvItem>, IOhlcvItemAware, AttributeModelAware
Dataset Domain Object for encapsulation of IOhlcv API structure.
-
-
Field Summary
Fields Modifier and Type Field Description static intDIM_Y_CLOSEstatic intDIM_Y_HIGHstatic intDIM_Y_LOWstatic intDIM_Y_OIstatic intDIM_Y_OPENstatic intDIM_Y_VOLUME-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
axisListener, dimension
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description OhlcvDataSet(java.lang.String title)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleget(int dimIndex, int index)Gets the x value of the data point with the index iAttributeModelgetAddon()AttributeModelgetAddonOrCreate()IOhlcvgetData()intgetDataCount()Get the number of data points in the data set.IOhlcvItemgetItem(int index)Provides OHLCV domain object with extensionsIOhlcvItemgetLastItem()intgetXIndex(double x)Gets the index of the data point closest to the given x coordinate.booleanisCategoryBased()java.util.Iterator<IOhlcvItem>iterator()DataSetset(DataSet other, boolean copy)voidsetCategoryBased(boolean categoryBased)Change category or time based axis handling.voidsetData(IOhlcv ohlcv)Set the domain object with OHLCV data.-
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, lock, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getStyle, set, setStyle
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener
-
-
-
-
Field Detail
-
DIM_Y_OPEN
public static final int DIM_Y_OPEN
- See Also:
- Constant Field Values
-
DIM_Y_HIGH
public static final int DIM_Y_HIGH
- See Also:
- Constant Field Values
-
DIM_Y_LOW
public static final int DIM_Y_LOW
- See Also:
- Constant Field Values
-
DIM_Y_CLOSE
public static final int DIM_Y_CLOSE
- See Also:
- Constant Field Values
-
DIM_Y_VOLUME
public static final int DIM_Y_VOLUME
- See Also:
- Constant Field Values
-
DIM_Y_OI
public static final int DIM_Y_OI
- See Also:
- Constant Field Values
-
-
Method Detail
-
setData
public void setData(IOhlcv ohlcv)
Set the domain object with OHLCV data.- Parameters:
ohlcv- connection with OHLCV data from financial framework.
-
getData
public IOhlcv getData()
- Returns:
- get domain object
-
isCategoryBased
public boolean isCategoryBased()
- Returns:
- is true for a category axis support
-
setCategoryBased
public void setCategoryBased(boolean categoryBased)
Change category or time based axis handling.- Parameters:
categoryBased- if true; category based indexes are used. Default false.
-
get
public double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
iterator
public java.util.Iterator<IOhlcvItem> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<IOhlcvItem>
-
getDataCount
public int getDataCount()
Description copied from interface:DataSetGet the number of data points in the data set.- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
getXIndex
public int getXIndex(double x)
Gets the index of the data point closest to the given x coordinate. If the x coordinate lies outside the range of the data set, the index of the first/last point is returned.- Parameters:
x- the x position of the data point- Returns:
- the index of the data point
-
getAddon
public AttributeModel getAddon()
- Specified by:
getAddonin interfaceAttributeModelAware- Returns:
- OHLCV addon. If not available, null is return.
-
getAddonOrCreate
public AttributeModel getAddonOrCreate()
- Specified by:
getAddonOrCreatein interfaceAttributeModelAware- Returns:
- OHLCV Item addon. If not available, create it.
-
getItem
public IOhlcvItem getItem(int index)
Description copied from interface:IOhlcvItemAwareProvides OHLCV domain object with extensions- Specified by:
getItemin interfaceIOhlcvItemAware- Parameters:
index- to the dataset/domain structure- Returns:
- the filled ohlcv item
-
getLastItem
public IOhlcvItem getLastItem()
-
-