objects.
| Method from org.jfree.data.time.ohlc.OHLCSeriesCollection Detail: |
public void addSeries(OHLCSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' argument.");
}
this.data.add(series);
series.addChangeListener(this);
fireDatasetChanged();
}
Adds a series to the collection and sends a DatasetChangeEvent
to all registered listeners. |
public Object clone() throws CloneNotSupportedException {
OHLCSeriesCollection clone
= (OHLCSeriesCollection) super.clone();
clone.data = (List) ObjectUtilities.deepClone(this.data);
return clone;
}
Returns a clone of this instance. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof OHLCSeriesCollection)) {
return false;
}
OHLCSeriesCollection that = (OHLCSeriesCollection) obj;
return ObjectUtilities.equal(this.data, that.data);
}
Tests this instance for equality with an arbitrary object. |
public Number getClose(int series,
int item) {
return new Double(getCloseValue(series, item));
}
Returns the close-value for an item within a series. |
public double getCloseValue(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
return di.getCloseValue();
}
Returns the close-value for an item within a series. |
public Number getHigh(int series,
int item) {
return new Double(getHighValue(series, item));
}
Returns the high-value for an item within a series. |
public double getHighValue(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
return di.getHighValue();
}
Returns the high-value for an item within a series. |
public int getItemCount(int series) {
// defer argument checking
return getSeries(series).getItemCount();
}
Returns the number of items in the specified series. |
public Number getLow(int series,
int item) {
return new Double(getLowValue(series, item));
}
Returns the low-value for an item within a series. |
public double getLowValue(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
return di.getLowValue();
}
Returns the low-value for an item within a series. |
public Number getOpen(int series,
int item) {
return new Double(getOpenValue(series, item));
}
Returns the open-value for an item within a series. |
public double getOpenValue(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
return di.getOpenValue();
}
Returns the open-value for an item within a series. |
public OHLCSeries getSeries(int series) {
if ((series < 0) || (series >= getSeriesCount())) {
throw new IllegalArgumentException("Series index out of bounds");
}
return (OHLCSeries) this.data.get(series);
}
Returns a series from the collection. |
public int getSeriesCount() {
return this.data.size();
}
Returns the number of series in the collection. |
public Comparable getSeriesKey(int series) {
// defer argument checking
return getSeries(series).getKey();
}
Returns the key for a series. |
public Number getVolume(int series,
int item) {
return null;
}
|
public double getVolumeValue(int series,
int item) {
return Double.NaN;
}
|
protected synchronized long getX(RegularTimePeriod period) {
long result = 0L;
if (this.xPosition == TimePeriodAnchor.START) {
result = period.getFirstMillisecond();
}
else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
result = period.getMiddleMillisecond();
}
else if (this.xPosition == TimePeriodAnchor.END) {
result = period.getLastMillisecond();
}
return result;
}
Returns the x-value for a time period. |
public Number getX(int series,
int item) {
return new Double(getXValue(series, item));
}
Returns the x-value for an item within a series. |
public double getXValue(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
RegularTimePeriod period = di.getPeriod();
return getX(period);
}
Returns the x-value for an item within a series. |
public Number getY(int series,
int item) {
OHLCSeries s = (OHLCSeries) this.data.get(series);
OHLCItem di = (OHLCItem) s.getDataItem(item);
return new Double(di.getYValue());
}
Returns the y-value for an item within a series. |