org.jfree.data.xy
Class OHLCDataItem

java.lang.Object
  extended byorg.jfree.data.xy.OHLCDataItem
All Implemented Interfaces:
java.lang.Comparable

public class OHLCDataItem
extends java.lang.Object
implements java.lang.Comparable

Represents a single (open-high-low-close) data item in an DefaultOHLCDataset. 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
OHLCDataItem(java.util.Date date, double open, double high, double low, double close, double volume)
          Creates a new item.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this object with the specified object for order.
 java.lang.Number getClose()
          Returns the close value.
 java.util.Date getDate()
          Returns the date that the data item relates to.
 java.lang.Number getHigh()
          Returns the high value.
 java.lang.Number getLow()
          Returns the low value.
 java.lang.Number getOpen()
          Returns the open value.
 java.lang.Number getVolume()
          Returns the volume.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OHLCDataItem

public OHLCDataItem(java.util.Date date,
                    double open,
                    double high,
                    double low,
                    double close,
                    double volume)
Creates a new item.

Parameters:
date - the date (null not permitted).
open - the open value.
high - the high value.
low - the low value.
close - the close value.
volume - the volume.
Method Detail

getDate

public java.util.Date getDate()
Returns the date that the data item relates to.

Returns:
The date (never null).

getOpen

public java.lang.Number getOpen()
Returns the open value.

Returns:
The open value.

getHigh

public java.lang.Number getHigh()
Returns the high value.

Returns:
The high value.

getLow

public java.lang.Number getLow()
Returns the low value.

Returns:
The low value.

getClose

public java.lang.Number getClose()
Returns the close value.

Returns:
The close value.

getVolume

public java.lang.Number getVolume()
Returns the volume.

Returns:
The volume.

compareTo

public int compareTo(java.lang.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:
compareTo in interface java.lang.Comparable
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.