public int compareTo ( Point < E > obj ) { if ( obj == null ) return - 1 ; if ( dimensions ( ) != obj . dimensions ( ) ) return - 1 ; for ( int i = 0 ; i < dimensions ( ) ; i ++ ) { if ( getValue ( i ) . getClass ( ) != obj . getValue ( i ) . getClass ( ) ) return - 1 ; if ( getValue ( i ) instanceof Double ) { if ( Utils . sm ( ( Double ) getValue ( i ) , ( Double ) obj . getValue ( i ) ) ) { return - 1 ; } else if ( Utils . gr ( ( Double ) getValue ( i ) , ( Double ) obj . getValue ( i ) ) ) { return 1 ; } } else { int r = getValue ( i ) . toString ( ) . compareTo ( obj . getValue ( i ) . toString ( ) ) ; if ( r != 0 ) { return r ; } } } return 0 ; }
Compares the given point with this point .