Example usage for org.jfree.data.time.ohlc OHLCItem getCloseValue

List of usage examples for org.jfree.data.time.ohlc OHLCItem getCloseValue

Introduction

In this page you can find the example usage for org.jfree.data.time.ohlc OHLCItem getCloseValue.

Prototype

public double getCloseValue() 

Source Link

Document

Returns the close value.

Usage

From source file:org.jfree.data.time.ohlc.OHLCSeries.java

/**
 * Adds a data item to the series.  The values from the item passed to
 * this method will be copied into a new object.
 * /*  ww  w.  j av a  2 s  .  co m*/
 * @param item  the item (<code>null</code> not permitted).
 * 
 * @since 1.0.17
 */
public void add(OHLCItem item) {
    ParamChecks.nullNotPermitted(item, "item");
    add(item.getPeriod(), item.getOpenValue(), item.getHighValue(), item.getLowValue(), item.getCloseValue());
}

From source file:org.jfree.data.time.ohlc.OHLCItemTest.java

/**
 * Some checks for the constructor.//from   www.  java  2  s  .  c om
 */
@Test
public void testConstructor1() {
    OHLCItem item1 = new OHLCItem(new Year(2006), 2.0, 4.0, 1.0, 3.0);
    assertEquals(new Year(2006), item1.getPeriod());
    assertEquals(2.0, item1.getOpenValue(), EPSILON);
    assertEquals(4.0, item1.getHighValue(), EPSILON);
    assertEquals(1.0, item1.getLowValue(), EPSILON);
    assertEquals(3.0, item1.getCloseValue(), EPSILON);
}

From source file:org.jfree.data.time.ohlc.OHLCSeriesCollection.java

/**
 * Returns the close-value for an item within a series.
 *
 * @param series  the series index.//from   w w w .j a  v a2  s .c o m
 * @param item  the item index.
 *
 * @return The close-value.
 */
@Override
public double getCloseValue(int series, int item) {
    OHLCSeries s = (OHLCSeries) this.data.get(series);
    OHLCItem di = (OHLCItem) s.getDataItem(item);
    return di.getCloseValue();
}