org.jfree.data.xy
public class: OHLCDataItem [javadoc |
source]
java.lang.Object
org.jfree.data.xy.OHLCDataItem
All Implemented Interfaces:
Serializable, 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: |
public OHLCDataItem(Date date,
double open,
double high,
double low,
double close,
double volume) {
if (date == null) {
throw new IllegalArgumentException("Null 'date' argument.");
}
this.date = date;
this.open = new Double(open);
this.high = new Double(high);
this.low = new Double(low);
this.close = new Double(close);
this.volume = new Double(volume);
}
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 from org.jfree.data.xy.OHLCDataItem Detail: |
public int compareTo(Object object) {
if (object instanceof OHLCDataItem) {
OHLCDataItem item = (OHLCDataItem) object;
return this.date.compareTo(item.date);
}
else {
throw new ClassCastException("OHLCDataItem.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. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof OHLCDataItem)) {
return false;
}
OHLCDataItem that = (OHLCDataItem) obj;
if (!this.date.equals(that.date)) {
return false;
}
if (!this.high.equals(that.high)) {
return false;
}
if (!this.low.equals(that.low)) {
return false;
}
if (!this.open.equals(that.open)) {
return false;
}
if (!this.close.equals(that.close)) {
return false;
}
return true;
}
Checks this instance for equality with an arbitrary object. |
public Number getClose() {
return this.close;
}
|
public Date getDate() {
return this.date;
}
Returns the date that the data item relates to. |
public Number getHigh() {
return this.high;
}
|
public Number getLow() {
return this.low;
}
|
public Number getOpen() {
return this.open;
}
|
public Number getVolume() {
return this.volume;
}
|