private float checkValid(final float val){
  float tempval=val;
  if (val > 1) {
    tempval=1;
  }
  if (val < 0) {
    tempval=0;
  }
  return tempval;
}

private float checkValid ( final float val ) { float tempval = val ; if ( val > 1 ) { tempval = 1 ; } if ( val < 0 ) { tempval = 0 ; } return tempval ; }
check whether the specified saturation is valid or not .
