org.jfree.data.xy

Class OHLCDataItem

Implemented Interfaces:
Comparable, Serializable

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

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(Date date, double open, double high, double low, double close, double volume)
Creates a new item.

Method Summary

int
compareTo(Object object)
Compares this object with the specified object for order.
boolean
equals(Object obj)
Checks this instance for equality with an arbitrary object.
Number
getClose()
Returns the close value.
Date
getDate()
Returns the date that the data item relates to.
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

public OHLCDataItem(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 Details

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.
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.

equals

public boolean equals(Object obj)
Checks this instance for equality with an arbitrary object.
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

getClose

public Number getClose()
Returns the close value.
Returns:
The close value.

getDate

public Date getDate()
Returns the date that the data item relates to.
Returns:
The date (never null).

getHigh

public Number getHigh()
Returns the high value.
Returns:
The high value.

getLow

public Number getLow()
Returns the low value.
Returns:
The low value.

getOpen

public Number getOpen()
Returns the open value.
Returns:
The open value.

getVolume

public Number getVolume()
Returns the volume.
Returns:
The volume.