Package java.nio

Examples of java.nio.FloatBuffer.compareTo()


        assertTrue(buf.capacity() > 5);
        buf.clear();
        FloatBuffer other = FloatBuffer.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);
       
        FloatBuffer fbuffer1 = FloatBuffer.wrap(new float[] { Float.NaN });
        FloatBuffer fbuffer2 = FloatBuffer.wrap(new float[] { Float.NaN });
        FloatBuffer fbuffer3 = FloatBuffer.wrap(new float[] { 42f });
View Full Code Here

        FloatBuffer fbuffer2 = FloatBuffer.wrap(new float[] { Float.NaN });
        FloatBuffer fbuffer3 = FloatBuffer.wrap(new float[] { 42f });

        assertEquals("Failed equal comparison with NaN entry", 0, fbuffer1
                .compareTo(fbuffer2));
        assertEquals("Failed greater than comparison with NaN entry", 1, fbuffer3
                .compareTo(fbuffer1));
        assertEquals("Failed greater than comparison with NaN entry", 1, fbuffer1
                .compareTo(fbuffer3));

    }
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.