Java Code Examples for org.apache.commons.lang3.math.NumberUtils.max()

The following are Jave code examples for showing how to use max() of the org.apache.commons.lang3.math.NumberUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: sumo   File: Ambiguity.java   View Source Code Vote up 6 votes
/**
 * 
 * @param boat
 * @param xPos
 * @param yPos
 * @param deltaAzimuth azimuth correction in pixels
 * @param pxSize
 * @param pySize
 * @return
 * @throws IOException
 */
protected boolean isAmbiguitySingleBand(Boat boat,int xPos, int yPos,int deltaAzimuth,double pxSize ,double pySize) throws IOException{
	Window winUp=Window.createWindowFromAzimuth(xPos, yPos, deltaAzimuth,pxSize ,pySize,true);
   // logger.info(new StringBuffer().append("\nSearch Window start from: ").append(winUp.x).append(" ").append(winUp.sizeY).append("  D Azimuth:").append(deltaAzimuth).toString());
    int maxVal=getWindowMaxPixelValue(winUp.x,winUp.y,winUp.sizeX,winUp.sizeY,band[0]);
    
    String bb=sumoImage.getBandName(band[0]);
    int boatMaxValue=NumberUtils.max(boat.getStatMap().getMaxValue(bb));
    if(maxVal>(boatMaxValue*AZIMUT_FACTOR)){
    	return true;
    }else{
    	Window winDown=Window.createWindowFromAzimuth(xPos, yPos, deltaAzimuth,pxSize ,pySize,false);
    	maxVal=getWindowMaxPixelValue(winDown.x,winDown.y,winDown.sizeX,winDown.sizeY,band[0]);
    	if(maxVal>(boatMaxValue*AZIMUT_FACTOR)){
        	return true;
    	}	
    }	
    return false;
}
 
Example 2
Project: sumo   File: Ambiguity.java   View Source Code Vote up 6 votes
/**
 * 
 * @param boat
 * @param xPos
 * @param yPos
 * @param deltaAzimuth azimuth correction in pixels
 * @param pxSize
 * @param pySize
 * @return
 * @throws IOException
 */
protected boolean isAmbiguityMultipleBand(Boat boat,int xPos, int yPos,int deltaAzimuth,double pxSize ,double pySize) throws IOException{
	for(int i=0;i<band.length;i++){
 	Window winUp=Window.createWindowFromAzimuth(xPos, yPos, deltaAzimuth,pxSize ,pySize,true);
    // logger.info(new StringBuffer().append("\nSearch Window start from: ").append(winUp.x).append(" ").append(winUp.sizeY).append("  D Azimuth:").append(deltaAzimuth).toString());
     int maxVal=getWindowMaxPixelValue(winUp.x,winUp.y,winUp.sizeX,winUp.sizeY,band[i]);
     
     String bb=sumoImage.getBandName(band[i]);
     int boatMaxValue=NumberUtils.max(boat.getStatMap().getMaxValue(bb));
     if(maxVal>(boatMaxValue*AZIMUT_FACTOR)){
     	return true;
     }else{
     	Window winDown=Window.createWindowFromAzimuth(xPos, yPos, deltaAzimuth,pxSize ,pySize,false);
     	maxVal=getWindowMaxPixelValue(winDown.x,winDown.y,winDown.sizeX,winDown.sizeY,band[i]);
     	if(maxVal>(boatMaxValue*AZIMUT_FACTOR)){
         	return true;
     	}	
     }	
  
	}
	return false;
}