Example usage for org.jfree.data.xy DefaultXYDataset indexOf

List of usage examples for org.jfree.data.xy DefaultXYDataset indexOf

Introduction

In this page you can find the example usage for org.jfree.data.xy DefaultXYDataset indexOf.

Prototype

@Override
public int indexOf(Comparable seriesKey) 

Source Link

Document

Returns the index of the series with the specified key, or -1 if there is no such series in the dataset.

Usage

From source file:org.jfree.data.xy.DefaultXYDatasetTest.java

/**
 * Some checks for the indexOf(Comparable) method.
 *//*from   ww  w.  j  a va  2 s  .c  o m*/
@Test
public void testIndexOf() {
    DefaultXYDataset d = createSampleDataset1();
    assertEquals(0, d.indexOf("S1"));
    assertEquals(1, d.indexOf("S2"));
    assertEquals(-1, d.indexOf("Green Eggs and Ham"));
    assertEquals(-1, d.indexOf(null));
}

From source file:org.jfree.data.xy.junit.DefaultXYDatasetTest.java

/**
 * Some checks for the indexOf(Comparable) method.
 *//*from w ww. j a  v  a  2s.c o  m*/
public void testIndexOf() {
    DefaultXYDataset d = createSampleDataset1();
    assertEquals(0, d.indexOf("S1"));
    assertEquals(1, d.indexOf("S2"));
    assertEquals(-1, d.indexOf("Green Eggs and Ham"));
    assertEquals(-1, d.indexOf(null));
}