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

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

Introduction

In this page you can find the example usage for org.jfree.data.xy VectorSeriesCollection 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.VectorSeriesCollectionTest.java

/**
 * Some checks for the removeSeries() method.
 */// w ww.  j a v a 2  s . c om
@Test
public void testRemoveSeries() {
    VectorSeries s1 = new VectorSeries("S1");
    VectorSeries s2 = new VectorSeries("S2");
    VectorSeriesCollection vsc = new VectorSeriesCollection();
    vsc.addSeries(s1);
    vsc.addSeries(s2);
    assertEquals(2, vsc.getSeriesCount());
    boolean b = vsc.removeSeries(s1);
    assertTrue(b);
    assertEquals(1, vsc.getSeriesCount());
    assertEquals("S2", vsc.getSeriesKey(0));
    b = vsc.removeSeries(new VectorSeries("NotInDataset"));
    assertFalse(b);
    assertEquals(1, vsc.getSeriesCount());
    b = vsc.removeSeries(s2);
    assertTrue(b);
    assertEquals(0, vsc.getSeriesCount());
}

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

/**
 * Some checks for the removeSeries() method.
 *//*from w  w w. j a v a2s.c om*/
public void testRemoveSeries() {
    VectorSeries s1 = new VectorSeries("S1");
    VectorSeries s2 = new VectorSeries("S2");
    VectorSeriesCollection vsc = new VectorSeriesCollection();
    vsc.addSeries(s1);
    vsc.addSeries(s2);
    assertEquals(2, vsc.getSeriesCount());
    boolean b = vsc.removeSeries(s1);
    assertTrue(b);
    assertEquals(1, vsc.getSeriesCount());
    assertEquals("S2", vsc.getSeriesKey(0));
    b = vsc.removeSeries(new VectorSeries("NotInDataset"));
    assertFalse(b);
    assertEquals(1, vsc.getSeriesCount());
    b = vsc.removeSeries(s2);
    assertTrue(b);
    assertEquals(0, vsc.getSeriesCount());
}