/**
   * calcTD Calculates the TD with the Putnam-Model TD = COCOMO-Time
   *
   * @param cocomoResult
   * @return calculated TD in months
   * @throws PutnamCalcException
   */
  private float calcTD(COCOMOResult cocomoResult) throws PutnamCalcException {

    if (cocomoResult == null) {
      this.logger.error("calcTD: COCOMO time was null");
      throw new PutnamCalcException("COCOMO time was null.");
    }

    float result = cocomoResult.getTime();

    return result;
  }
  @Override
  public PutnamResult calc(float sloc, float pp, COCOMOResult cocomoResults)
      throws PutnamCalcException, EntityNotFoundException, DatabaseConnectionException {

    if (sloc <= 0) {
      this.logger.error("calc: Sourcelines of code were null");
      throw new PutnamCalcException("Sourcelines of code were null.");
    } else if (pp <= 0) {
      this.logger.error("calc: PP was null");
      throw new PutnamCalcException("PP was null.");
    } else if (cocomoResults == null) {
      this.logger.error("calc: COCOMO time was null");
      throw new PutnamCalcException("COCOMO time was null.");
    }

    float eff = calcEffort(sloc, pp, cocomoResults.getTime());
    float mbi = calcMBI(eff, cocomoResults.getTime());
    float td = calcTD(cocomoResults);

    return new PutnamResult(eff, mbi, td);
  }