Example usage for org.jfree.data.time.ohlc OHLCSeries indexOf

List of usage examples for org.jfree.data.time.ohlc OHLCSeries indexOf

Introduction

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

Prototype

public int indexOf(Comparable x) 

Source Link

Document

Returns the index of the item with the specified x-value, or a negative index if the series does not contain an item with that x-value.

Usage

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

/**
 * Simple test for the indexOf() method.
 *///from  w w  w . ja va2s .  c o m
@Test
public void testIndexOf() {
    OHLCSeries s1 = new OHLCSeries("s1");
    s1.add(new Year(2006), 2.0, 4.0, 1.0, 3.0);
    s1.add(new Year(2011), 2.0, 4.0, 1.0, 3.0);
    s1.add(new Year(2010), 2.0, 4.0, 1.0, 3.0);
    assertEquals(0, s1.indexOf(new Year(2006)));
    assertEquals(1, s1.indexOf(new Year(2010)));
    assertEquals(2, s1.indexOf(new Year(2011)));
}