code: private Number calculatePercentComplete(Row row)
     {
        Number result;
        switch (PercentCompleteType.getInstance(row.getString("complete_pct_type")))
        {
           case UNITS:
           {
              result = calculateUnitsPercentComplete(row);
              break;
           }
  
           case DURATION:
           {
              result = calculateDurationPercentComplete(row);
              break;
           }
  
           default:
           {
              result = calculatePhysicalPercentComplete(row);
              break;
           }
        }
  
        return result;
     }
docs: Determine which type of percent complete is used on on this task,
  and calculate the required value.
  
  @param row task data
  @return percent complete value