code: private int getCostRateTableEntryIndex(Date date)
     {
        int result = -1;
  
        CostRateTable table = getCostRateTable();
        if (table != null)
        {
           if (table.size() == 1)
           {
              result = 0;
           }
           else
           {
              result = table.getIndexByDate(date);
           }
        }
  
        return result;
     }
docs: Retrieves the index of a cost rate table entry active on a given date.
  
  @param date target date
  @return cost rate table entry index