Package java.nio

Examples of java.nio.DoubleBuffer.compareTo()


    public void testCompareTo() {
        DoubleBuffer other = DoubleBuffer.allocate(buf.capacity());
        loadTestData1(other);
        assertEquals(0, buf.compareTo(other));
        assertEquals(0, other.compareTo(buf));
        buf.position(1);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);
        other.position(2);
        assertTrue(buf.compareTo(other) < 0);
View Full Code Here


        loadTestData1(other);
        assertEquals(0, buf.compareTo(other));
        assertEquals(0, other.compareTo(buf));
        buf.position(1);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);
        other.position(2);
        assertTrue(buf.compareTo(other) < 0);
        assertTrue(other.compareTo(buf) > 0);
        buf.position(2);
        other.limit(5);
View Full Code Here

        buf.position(1);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);
        other.position(2);
        assertTrue(buf.compareTo(other) < 0);
        assertTrue(other.compareTo(buf) > 0);
        buf.position(2);
        other.limit(5);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);
View Full Code Here

        assertTrue(buf.compareTo(other) < 0);
        assertTrue(other.compareTo(buf) > 0);
        buf.position(2);
        other.limit(5);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);

        DoubleBuffer dbuffer1 = DoubleBuffer.wrap(new double[] { Double.NaN });
        DoubleBuffer dbuffer2 = DoubleBuffer.wrap(new double[] { Double.NaN });
        DoubleBuffer dbuffer3 = DoubleBuffer.wrap(new double[] { 42d });
View Full Code Here

        DoubleBuffer dbuffer2 = DoubleBuffer.wrap(new double[] { Double.NaN });
        DoubleBuffer dbuffer3 = DoubleBuffer.wrap(new double[] { 42d });

        assertEquals("Failed equal comparison with NaN entry", 0, dbuffer1
                .compareTo(dbuffer2));
        assertEquals("Failed greater than comparison with NaN entry", 1, dbuffer3
                .compareTo(dbuffer1));
        assertEquals("Failed greater than comparison with NaN entry", 1, dbuffer1
                .compareTo(dbuffer3));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.