📄 subseriesdataset.java
字号:
* @param series the series (zero based index).
* @param item the item (zero based index).
*
* @return the volume.
*/
public Number getVolume(int series, int item) {
return ((OHLCDataset) this.parent).getVolume(this.map[series], item);
}
/**
* Returns the volume-value (as a double primitive) for an item within a series.
*
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The volume-value.
*/
public double getVolumeValue(int series, int item) {
double result = Double.NaN;
Number volume = getVolume(series, item);
if (volume != null) {
result = volume.doubleValue();
}
return result;
}
///////////////////////////////////////////////////////////////////////////
// From XYDataset
///////////////////////////////////////////////////////////////////////////
/**
* Returns the X-value for the specified series and item.
* <p>
* Note: throws <code>ClassCastException</code> if the series if not from a
* {@link XYDataset}.
*
* @param series the index of the series of interest (zero-based);
* @param item the index of the item of interest (zero-based).
*
* @return the X-value for the specified series and item.
*/
public Number getX(int series, int item) {
return ((XYDataset) this.parent).getX(this.map[series], item);
}
/**
* Returns the Y-value for the specified series and item.
* <p>
* Note: throws <code>ClassCastException</code> if the series if not from a
* {@link XYDataset}.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return the Y-value for the specified series and item.
*/
public Number getY(int series, int item) {
return ((XYDataset) this.parent).getY(this.map[series], item);
}
/**
* Returns the number of items in a series.
* <p>
* Note: throws <code>ClassCastException</code> if the series if not from a
* {@link XYDataset}.
*
* @param series the index of the series of interest (zero-based).
*
* @return the number of items in a series.
*/
public int getItemCount(final int series) {
return ((XYDataset) this.parent).getItemCount(this.map[series]);
}
///////////////////////////////////////////////////////////////////////////
// From SeriesDataset
///////////////////////////////////////////////////////////////////////////
/**
* Returns the number of series in the dataset.
*
* @return the number of series in the dataset.
*/
public int getSeriesCount() {
return this.map.length;
}
/**
* Returns the name of a series.
*
* @param series the series (zero-based index).
*
* @return the name of a series.
*/
public String getSeriesName(final int series) {
return this.parent.getSeriesName(this.map[series]);
}
///////////////////////////////////////////////////////////////////////////
// From IntervalXYDataset
///////////////////////////////////////////////////////////////////////////
/**
* Returns the starting X value for the specified series and item.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return the starting X value for the specified series and item.
*/
public Number getStartX(int series, int item) {
if (this.parent instanceof IntervalXYDataset) {
return ((IntervalXYDataset) this.parent).getStartX(this.map[series], item);
}
else {
return getX(series, item);
}
}
/**
* Returns the ending X value for the specified series and item.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return the ending X value for the specified series and item.
*/
public Number getEndX(int series, int item) {
if (this.parent instanceof IntervalXYDataset) {
return ((IntervalXYDataset) this.parent).getEndX(this.map[series], item);
}
else {
return getX(series, item);
}
}
/**
* Returns the starting Y value for the specified series and item.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return the starting Y value for the specified series and item.
*/
public Number getStartY(int series, int item) {
if (this.parent instanceof IntervalXYDataset) {
return ((IntervalXYDataset) this.parent).getStartY(this.map[series], item);
}
else {
return getY(series, item);
}
}
/**
* Returns the ending Y value for the specified series and item.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return the ending Y value for the specified series and item.
*/
public Number getEndY(int series, int item) {
if (this.parent instanceof IntervalXYDataset) {
return ((IntervalXYDataset) this.parent).getEndY(this.map[series], item);
}
else {
return getY(series, item);
}
}
///////////////////////////////////////////////////////////////////////////
// From SignalsDataset
///////////////////////////////////////////////////////////////////////////
/**
* Returns the type.
*
* @param series the series (zero based index).
* @param item the item (zero based index).
*
* @return the type.
*/
public int getType(final int series, final int item) {
if (this.parent instanceof SignalsDataset) {
return ((SignalsDataset) this.parent).getType(this.map[series], item);
}
else {
return getY(series, item).intValue();
}
}
/**
* Returns the level.
*
* @param series the series (zero based index).
* @param item the item (zero based index).
*
* @return the level.
*/
public double getLevel(final int series, final int item) {
if (this.parent instanceof SignalsDataset) {
return ((SignalsDataset) this.parent).getLevel(this.map[series], item);
}
else {
return getYValue(series, item);
}
}
///////////////////////////////////////////////////////////////////////////
// New methods from CombinationDataset
///////////////////////////////////////////////////////////////////////////
/**
* Returns the parent Dataset of this combination.
*
* @return the parent Dataset of this combination.
*/
public SeriesDataset getParent() {
return this.parent;
}
/**
* Returns a map or indirect indexing form our series into parent's series.
*
* @return a map or indirect indexing form our series into parent's series.
*/
public int[] getMap() {
return (int[]) this.map.clone();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -