Double dbl = GfrDouble.valueOf(str);
if (dbl == null)
{
validityChanged(new GfrEvtValidityChanged(
false,
"Please provide valid depth value"));
return false;
}
//-- Converting in meters to check the unicity of the depth.
dbl = Double.valueOf(getValueDepthInMeters());
if (this._alreadyExistsDepth_(dbl))
{
validityChanged(new GfrEvtValidityChanged(false, "Already existing with same depth"));
return false;
}
if (!this._farEnoughFromExistingDepth_(dbl))
{
validityChanged(new GfrEvtValidityChanged(false, "Too close to existing depths"));
return false;
}
if (dbl > this._dblMax_)
{
validityChanged(new GfrEvtValidityChanged(false, "Depth should be lower than : " +
String.format("%.2f", this._dblMax_)));
return false;
}
if (dbl < this._dblMin_)
{
validityChanged(new GfrEvtValidityChanged(false, "Depth should be higher than : " +
String.format("%.2f", this._dblMin_)));
return false;
}
return true;