public int compareTo ( Shard other ) { // compare version if ( version < other . version ) { return - 1 ; } else if ( version > other . version ) { return 1 ; } // compare dir int result = dir . compareTo ( other . dir ) ; if ( result != 0 ) { return result ; } // compare gen if ( gen < other . gen ) { return - 1 ; } else if ( gen == other . gen ) { return 0 ; } else { return 1 ; } }
Compare to another shard .