Package org.jfree.data.statistics

Examples of org.jfree.data.statistics.HistogramBin


     * Confirm that cloning works.
     */
    public void testCloning() {
        double start = 10.0;
        double end = 20.0;
        HistogramBin b1 = new HistogramBin(start, end);
        HistogramBin b2 = null;
        try {
            b2 = (HistogramBin) b1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(b1 != b2);
        assertTrue(b1.getClass() == b2.getClass());
        assertTrue(b1.equals(b2));
    }
View Full Code Here


     */
    public void testSerialization() {

        double start = 10.0;
        double end = 20.0;
        HistogramBin b1 = new HistogramBin(start, end);
        HistogramBin b2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(b1);
View Full Code Here

    private static IntervalXYDataset createDataset() {
        HistogramDataset dataset = new HistogramDataset("H1");
        double lower = 0.0;
        for (int i = 0; i < 100; i++) {
            double upper = (i + 1) / 10.0;
            HistogramBin bin = new HistogramBin(lower, upper, true,
                       false);
            dataset.addBin(bin);
            lower = upper;
        }
        double[] values = new double[1000];
View Full Code Here

     */
    public void testEquals() {
       
        double start = 10.0;
        double end = 20.0;
        HistogramBin b1 = new HistogramBin(start, end);
        HistogramBin b2 = new HistogramBin(start, end);
       
        assertTrue(b1.equals(b2));
        assertTrue(b2.equals(b1));

    }
View Full Code Here

     * Confirm that cloning works.
     */
    public void testCloning() {
        double start = 10.0;
        double end = 20.0;
        HistogramBin b1 = new HistogramBin(start, end);
        HistogramBin b2 = null;
        try {
            b2 = (HistogramBin) b1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(b1 != b2);
        assertTrue(b1.getClass() == b2.getClass());
        assertTrue(b1.equals(b2));
    }
View Full Code Here

     */
    public void testSerialization() {

        double start = 10.0;
        double end = 20.0;
        HistogramBin b1 = new HistogramBin(start, end);
        HistogramBin b2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(b1);
View Full Code Here

TOP

Related Classes of org.jfree.data.statistics.HistogramBin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.