private Double interpolate(Number av1,Number av2,int year1,int year2,int now){
  if (av1 == null && av2 == null) {
    return null;
  }
  if (av1 == null) {
    av1=0.0;
  }
  if (av2 == null) {
    av2=0.0;
  }
  if (year1 == year2) {
    return av1.doubleValue();
  }
  return av1.doubleValue() + (av2.doubleValue() - av1.doubleValue()) * (now - year1) / (year2 - year1);
}

private Double interpolate ( Number av1 , Number av2 , int year1 , int year2 , int now ) { if ( av1 == null && av2 == null ) { return null ; } if ( av1 == null ) { av1 = 0.0 ; } if ( av2 == null ) { av2 = 0.0 ; } if ( year1 == year2 ) { return av1 . doubleValue ( ) ; } return av1 . doubleValue ( ) + ( av2 . doubleValue ( ) - av1 . doubleValue ( ) ) * ( now - year1 ) / ( year2 - year1 ) ; }
given values for two years , interpolates or extrapolates value for another given year . if one of the two values is null , it is treated as 0 .
