@ Override public int compare ( Point pointOne , Point pointTwo ) { if ( pointOne == null ) { throw new JMetalException ( "PointOne is null" ) ; } else if ( pointTwo == null ) { throw new JMetalException ( "PointTwo is null" ) ; } else if ( pointOne . getDimension ( ) != pointTwo . getDimension ( ) ) { throw new JMetalException ( "Points have different size: " + pointOne . getDimension ( ) + " and " + pointTwo . getDimension ( ) ) ; } for ( int i = pointOne . getDimension ( ) - 1 ; i >= 0 ; i -- ) { if ( isBetter ( pointOne . getValue ( i ) , pointTwo . getValue ( i ) ) ) { return - 1 ; } else if ( isBetter ( pointTwo . getValue ( i ) , pointOne . getValue ( i ) ) ) { return 1 ; } } return 0 ; }
Compares two Point objects