Package org.jfree.data
Class OHLCDataItem
java.lang.Object
org.jfree.data.OHLCDataItem
- All Implemented Interfaces:
Comparable
public class OHLCDataItem extends Object implements Comparable
Represents a single (open-high-low-close) data item in an
OHLCDataset
. This data item is commonly used to summarise the trading
activity of a financial commodity for a fixed period (most often one day).-
Constructor Summary
Constructors Constructor Description OHLCDataItem(Date date, double open, double high, double low, double close, double volume)
Creates a new item. -
Method Summary
Modifier and Type Method Description int
compareTo(Object object)
Compares this object with the specified object for order.Number
getClose()
Returns the close value.Date
getDate()
Returns the date.Number
getHigh()
Returns the high value.Number
getLow()
Returns the low value.Number
getOpen()
Returns the open value.Number
getVolume()
Returns the volume.
-
Constructor Details
-
OHLCDataItem
Creates a new item.- Parameters:
date
- the date.open
- the open value.high
- the high value.low
- the low value.close
- the close value.volume
- the volume.
-
-
Method Details
-
getDate
Returns the date.- Returns:
- the date.
-
getOpen
Returns the open value.- Returns:
- the open value.
-
getHigh
Returns the high value.- Returns:
- the high value.
-
getLow
Returns the low value.- Returns:
- the low value.
-
getClose
Returns the close value.- Returns:
- the close value.
-
getVolume
Returns the volume.- Returns:
- the volume.
-
compareTo
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareTo
in interfaceComparable
- Parameters:
object
- the object to compare to.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-