Example usage for org.jfree.data.xy XIntervalSeriesCollection getSeriesCount

List of usage examples for org.jfree.data.xy XIntervalSeriesCollection getSeriesCount

Introduction

In this page you can find the example usage for org.jfree.data.xy XIntervalSeriesCollection getSeriesCount.

Prototype

@Override
public int getSeriesCount() 

Source Link

Document

Returns the number of series in the collection.

Usage

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

/**
 * Some basic checks for the removeSeries() method.
 *///from  ww w . j  a va2s .c o  m
@Test
public void testRemoveSeries() {
    XIntervalSeriesCollection c = new XIntervalSeriesCollection();
    XIntervalSeries s1 = new XIntervalSeries("s1");
    c.addSeries(s1);
    c.removeSeries(0);
    assertEquals(0, c.getSeriesCount());
    c.addSeries(s1);

    boolean pass = false;
    try {
        c.removeSeries(-1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    pass = false;
    try {
        c.removeSeries(1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);
}

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

/**
 * Some basic checks for the removeSeries() method.
 *//*from w w w  .  ja va 2 s  .  c o  m*/
public void testRemoveSeries() {
    XIntervalSeriesCollection c = new XIntervalSeriesCollection();
    XIntervalSeries s1 = new XIntervalSeries("s1");
    c.addSeries(s1);
    c.removeSeries(0);
    assertEquals(0, c.getSeriesCount());
    c.addSeries(s1);

    boolean pass = false;
    try {
        c.removeSeries(-1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    pass = false;
    try {
        c.removeSeries(1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);
}