Package org.jfree.data.function

Examples of org.jfree.data.function.LineFunction2D


    /**
     * Some tests for the constructor.
     */
    public void testConstructor() {
        LineFunction2D f = new LineFunction2D(1.0, 2.0);
        assertEquals(1.0, f.getIntercept(), EPSILON);
        assertEquals(2.0, f.getSlope(), EPSILON);
    }
View Full Code Here


    /**
     * For datasets, the equals() method just checks keys and values.
     */
    public void testEquals() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = new LineFunction2D(1.0, 2.0);
        assertTrue(f1.equals(f2));
        f1 = new LineFunction2D(2.0, 3.0);
        assertFalse(f1.equals(f2));
        f2 = new LineFunction2D(2.0, 3.0);
        assertTrue(f1.equals(f2));
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = null;

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

    /**
     * Objects that are equal should have the same hash code otherwise FindBugs
     * will tell on us...
     */
    public void testHashCode() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = new LineFunction2D(1.0, 2.0);
        assertEquals(f1.hashCode(), f2.hashCode());
    }
View Full Code Here

    /**
     * Some checks for the sampleFunction2D() method.
     */
    public void testSampleFunction2D() {
        Function2D f = new LineFunction2D(0, 1);
        XYDataset dataset = DatasetUtilities.sampleFunction2D(f, 0.0, 1.0, 2,
                "S1");
        assertEquals(1, dataset.getSeriesCount());
        assertEquals("S1", dataset.getSeriesKey(0));
        assertEquals(2, dataset.getItemCount(0));
View Full Code Here

    /**
     * Some tests for the constructor.
     */
    public void testConstructor() {
        LineFunction2D f = new LineFunction2D(1.0, 2.0);
        assertEquals(1.0, f.getIntercept(), EPSILON);
        assertEquals(2.0, f.getSlope(), EPSILON);
    }
View Full Code Here

    /**
     * For datasets, the equals() method just checks keys and values.
     */
    public void testEquals() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = new LineFunction2D(1.0, 2.0);
        assertTrue(f1.equals(f2));
        f1 = new LineFunction2D(2.0, 3.0);
        assertFalse(f1.equals(f2));
        f2 = new LineFunction2D(2.0, 3.0);
        assertTrue(f1.equals(f2));
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = null;

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

    /**
     * Objects that are equal should have the same hash code otherwise FindBugs
     * will tell on us...
     */
    public void testHashCode() {
        LineFunction2D f1 = new LineFunction2D(1.0, 2.0);
        LineFunction2D f2 = new LineFunction2D(1.0, 2.0);
        assertEquals(f1.hashCode(), f2.hashCode());
    }
View Full Code Here

    /**
     * Some checks for the sampleFunction2D() method.
     */
    public void testSampleFunction2D() {
        Function2D f = new LineFunction2D(0, 1);
        XYDataset dataset = DatasetUtilities.sampleFunction2D(f, 0.0, 1.0, 2,
                "S1");
        assertEquals(1, dataset.getSeriesCount());
        assertEquals("S1", dataset.getSeriesKey(0));
        assertEquals(2, dataset.getItemCount(0));
View Full Code Here

TOP

Related Classes of org.jfree.data.function.LineFunction2D

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.