Package org.jfree.data.xy
Class OHLCDataItem
- java.lang.Object
-
- org.jfree.data.xy.OHLCDataItem
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
public class OHLCDataItem extends java.lang.Object implements java.lang.Comparable, java.io.SerializableRepresents 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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.NumbercloseThe close value.private java.util.DatedateThe date.private java.lang.NumberhighThe high value.private java.lang.NumberlowThe low value.private java.lang.NumberopenThe open value.private static longserialVersionUIDFor serialization.private java.lang.NumbervolumeThe trading volume (number of shares, contracts or whatever).
-
Constructor Summary
Constructors Constructor Description OHLCDataItem(java.util.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(java.lang.Object object)Compares this object with the specified object for order.booleanequals(java.lang.Object obj)Checks this instance for equality with an arbitrary object.java.lang.NumbergetClose()Returns the close value.java.util.DategetDate()Returns the date that the data item relates to.java.lang.NumbergetHigh()Returns the high value.java.lang.NumbergetLow()Returns the low value.java.lang.NumbergetOpen()Returns the open value.java.lang.NumbergetVolume()Returns the volume.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
date
private java.util.Date date
The date.
-
open
private java.lang.Number open
The open value.
-
high
private java.lang.Number high
The high value.
-
low
private java.lang.Number low
The low value.
-
close
private java.lang.Number close
The close value.
-
volume
private java.lang.Number volume
The trading volume (number of shares, contracts or whatever).
-
-
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 (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 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 (never
null).
-
getHigh
public java.lang.Number getHigh()
Returns the high value.- Returns:
- The high value (never
null).
-
getLow
public java.lang.Number getLow()
Returns the low value.- Returns:
- The low value (never
null).
-
getClose
public java.lang.Number getClose()
Returns the close value.- Returns:
- The close value (never
null).
-
getVolume
public java.lang.Number getVolume()
Returns the volume.- Returns:
- The volume (never
null).
-
equals
public boolean equals(java.lang.Object obj)
Checks this instance for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
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:
compareToin interfacejava.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.
-
-