- java.lang.Object
-
- org.jfree.data.general.Series<K>
-
- org.jfree.data.ComparableObjectSeries<S>
-
- org.jfree.data.time.ohlc.OHLCSeries<S>
-
- All Implemented Interfaces:
Serializable,Cloneable
public class OHLCSeries<S extends Comparable<S>> extends ComparableObjectSeries<S>
A list of (RegularTimePeriod, open, high, low, close) data items.- Since:
- 1.0.4
- See Also:
OHLCSeriesCollection, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jfree.data.ComparableObjectSeries
data
-
-
Constructor Summary
Constructors Constructor Description OHLCSeries(S key)Creates a new empty series.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(OHLCItem item)Adds a data item to the series.voidadd(RegularTimePeriod period, double open, double high, double low, double close)Adds a data item to the series.ComparableObjectItemgetDataItem(int index)Returns the data item at the specified index.RegularTimePeriodgetPeriod(int index)Returns the time period for the specified item.ComparableObjectItemremove(int index)Removes the item with the specified index.-
Methods inherited from class org.jfree.data.ComparableObjectSeries
add, add, add, clear, clone, delete, equals, getAllowDuplicateXValues, getAutoSort, getItemCount, getMaximumItemCount, hashCode, indexOf, remove, setMaximumItemCount, update, updateByIndex
-
Methods inherited from class org.jfree.data.general.Series
addChangeListener, fireSeriesChanged, getKey, getNotify, isEmpty, notifyListeners, removeChangeListener, setNotify
-
-
-
-
Constructor Detail
-
OHLCSeries
public OHLCSeries(S key)
Creates a new empty series. By default, items added to the series will be sorted into ascending order by period, and duplicate periods will not be allowed.- Parameters:
key- the series key (nullnot permitted).
-
-
Method Detail
-
getPeriod
public RegularTimePeriod getPeriod(int index)
Returns the time period for the specified item.- Parameters:
index- the item index.- Returns:
- The time period.
-
getDataItem
public ComparableObjectItem getDataItem(int index)
Returns the data item at the specified index.- Overrides:
getDataItemin classComparableObjectSeries<S extends Comparable<S>>- Parameters:
index- the item index.- Returns:
- The data item.
-
add
public void add(RegularTimePeriod period, double open, double high, double low, double close)
Adds a data item to the series.- Parameters:
period- the period.open- the open-value.high- the high-value.low- the low-value.close- the close-value.
-
add
public void add(OHLCItem item)
Adds a data item to the series. The values from the item passed to this method will be copied into a new object.- Parameters:
item- the item (nullnot permitted).- Since:
- 1.0.17
-
remove
public ComparableObjectItem remove(int index)
Removes the item with the specified index.- Overrides:
removein classComparableObjectSeries<S extends Comparable<S>>- Parameters:
index- the item index.- Returns:
- The item removed.
- Since:
- 1.0.14
-
-