Code example for UUID

Methods: version

0
    } 
 
    public String describeCompare(UUID u1, UUID u2, int c)
    { 
        String tb1 = (u1 == null) ? "null" : (u1.version() == 1) ? "time-based " : "random ";
        String tb2 = (u2 == null) ? "null" : (u2.version() == 1) ? "time-based " : "random ";
        String comp = (c < 0) ? " < " : ((c == 0) ? " = " : " > ");
        return tb1 + u1 + comp + tb2 + u2;
    } 
 
    public int sign(int i)
    { 
        if (i < 0)
        { 
            return -1; 
        } 
        if (i > 0)
        { 
            return 1; 
        } 
        return 0;