Example usage for org.jfree.data.statistics SimpleHistogramDataset getItemCount

List of usage examples for org.jfree.data.statistics SimpleHistogramDataset getItemCount

Introduction

In this page you can find the example usage for org.jfree.data.statistics SimpleHistogramDataset getItemCount.

Prototype

@Override
public int getItemCount(int series) 

Source Link

Document

Returns the number of items in a series.

Usage

From source file:org.jfree.data.statistics.SimpleHistogramDatasetTest.java

/**
 * Some checks for the clearObservations() method.
 *///from ww  w.  j  a va2 s.c o m
@Test
public void testClearObservations() {
    SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
    d1.clearObservations();
    assertEquals(0, d1.getItemCount(0));
    d1.addBin(new SimpleHistogramBin(0.0, 1.0));
    d1.addObservation(0.5);
    assertEquals(1.0, d1.getYValue(0, 0), EPSILON);
}

From source file:org.jfree.data.statistics.SimpleHistogramDatasetTest.java

/**
 * Some checks for the removeAllBins() method.
 *///  w  ww. ja  v a  2 s .  co  m
@Test
public void testRemoveAllBins() {
    SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
    d1.addBin(new SimpleHistogramBin(0.0, 1.0));
    d1.addObservation(0.5);
    d1.addBin(new SimpleHistogramBin(2.0, 3.0));
    assertEquals(2, d1.getItemCount(0));
    d1.removeAllBins();
    assertEquals(0, d1.getItemCount(0));
}