Package java.util

Examples of java.util.UUID.compareTo()


      {
        UUID id = new UUID(ids[i].getMostSignificantBits(),
                           ids[i].getLeastSignificantBits());
        for(int j = 0; j < ids.length; j++)
          {
            int c1 = id.compareTo(ids[j]);
            int c2;
            if( i < j ) c2 = -1;
            else if( i > j) c2 = 1;
            else c2 = 0;
            harness.check(c1, c2);
View Full Code Here


        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));
    }

    /**
     * @see UUID#hashCode()
     */
 
View Full Code Here

    /**
     * @see UUID#compareTo(UUID)
     */
    public void test_compareTo() {
        UUID uuid1 = new UUID(0, 0);
        assertEquals(0, uuid1.compareTo(uuid1));
        UUID uuid2 = new UUID(1, 0);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
View Full Code Here

    public void test_compareTo() {
        UUID uuid1 = new UUID(0, 0);
        assertEquals(0, uuid1.compareTo(uuid1));
        UUID uuid2 = new UUID(1, 0);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));
    }
View Full Code Here

    /**
     * @see UUID#compareTo(UUID)
     */
    public void test_compareTo() {
        UUID uuid1 = new UUID(0, 0);
        assertEquals(0, uuid1.compareTo(uuid1));
        UUID uuid2 = new UUID(1, 0);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
View Full Code Here

    public void test_compareTo() {
        UUID uuid1 = new UUID(0, 0);
        assertEquals(0, uuid1.compareTo(uuid1));
        UUID uuid2 = new UUID(1, 0);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));
    }
View Full Code Here

        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));

        uuid2 = new UUID(0, 1);
        assertEquals(-1, uuid1.compareTo(uuid2));
        assertEquals(1, uuid2.compareTo(uuid1));
    }

    /**
     * @see UUID#hashCode()
     */
 
View Full Code Here

        ByteBuffer vb = ti.decompose(vu);

        assertEquals(-1, ti.compare(zb, vb));
        assertEquals(1, zu.compareTo(vu));
        assertEquals(1, ti.compare(vb, zb));
        assertEquals(-1, vu.compareTo(zu));
    }
}
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.