- java.lang.Object
-
- org.jfree.data.xy.OHLCDataItem
-
- All Implemented Interfaces:
Serializable,Comparable
public class OHLCDataItem extends Object implements Comparable, Serializable
Represents a single (open-high-low-close) data item in anDefaultOHLCDataset. This data item is commonly used to summarise the trading activity of a financial commodity for a fixed period (most often one day).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OHLCDataItem(Date date, double open, double high, double low, double close, double volume)Creates a new item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object object)Compares this object with the specified object for order.booleanequals(Object obj)Checks this instance for equality with an arbitrary object.NumbergetClose()Returns the close value.DategetDate()Returns the date that the data item relates to.NumbergetHigh()Returns the high value.NumbergetLow()Returns the low value.NumbergetOpen()Returns the open value.NumbergetVolume()Returns the volume.
-
-
-
Constructor Detail
-
OHLCDataItem
public OHLCDataItem(Date date, double open, double high, double low, double close, double volume)
Creates a new item.- Parameters:
date- the date (nullnot permitted).open- the open value.high- the high value.low- the low value.close- the close value.volume- the volume.
-
-
Method Detail
-
getDate
public Date getDate()
Returns the date that the data item relates to.- Returns:
- The date (never
null).
-
equals
public boolean equals(Object obj)
Checks this instance for equality with an arbitrary object.
-
compareTo
public int compareTo(Object object)
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:
compareToin 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.
-
-