TimeSeriesReturnCalculatorFactory { public static TimeSeriesReturnCalculator getReturnCalculator(final String calculatorName) { if (s_staticLenientInstances.containsKey(calculatorName)) { return s_staticLenientInstances.get(calculatorName); } if (s_staticStrictInstances.containsKey(calculatorName)) { return s_staticStrictInstances.get(calculatorName); } throw new IllegalArgumentException("Do not have calculator for " + calculatorName); }  static String getReturnCalculatorName(final TimeSeriesReturnCalculator calculator); static String getReturnCalculatorName(final TimeSeriesReturnCalculator calculator, final CalculationMode mode); static TimeSeriesReturnCalculator getReturnCalculator(final String calculatorName); static TimeSeriesReturnCalculator getReturnCalculator(final String calculatorName, final CalculationMode mode); static final String CONTINUOUS_RELATIVE_STRICT; static final String CONTINUOUS_STRICT; static final String EXCESS_CONTINUOUS_STRICT; static final String EXCESS_SIMPLE_NET_STRICT; static final String SIMPLE_GROSS_STRICT; static final String SIMPLE_NET_STRICT; static final String SIMPLE_NET_RELATIVE_STRICT; static final String CONTINUOUS_RELATIVE_LENIENT; static final String CONTINUOUS_LENIENT; static final String EXCESS_CONTINUOUS_LENIENT; static final String EXCESS_SIMPLE_NET_LENIENT; static final String SIMPLE_GROSS_LENIENT; static final String SIMPLE_NET_LENIENT; static final String SIMPLE_NET_RELATIVE_LENIENT; static final ContinuouslyCompoundedRelativeTimeSeriesReturnCalculator CONTINUOUS_RELATIVE_STRICT_CALCULATOR; static final ContinuouslyCompoundedTimeSeriesReturnCalculator CONTINUOUS_STRICT_CALCULATOR; static final ExcessContinuouslyCompoundedTimeSeriesReturnCalculator EXCESS_CONTINUOUS_STRICT_CALCULATOR; static final ExcessSimpleNetTimeSeriesReturnCalculator EXCESS_SIMPLE_NET_STRICT_CALCULATOR; static final SimpleGrossTimeSeriesReturnCalculator SIMPLE_GROSS_STRICT_CALCULATOR; static final SimpleNetTimeSeriesReturnCalculator SIMPLE_NET_STRICT_CALCULATOR; static final SimpleNetRelativeTimeSeriesReturnCalculator SIMPLE_NET_RELATIVE_STRICT_CALCULATOR; static final ContinuouslyCompoundedRelativeTimeSeriesReturnCalculator CONTINUOUS_RELATIVE_LENIENT_CALCULATOR; static final ContinuouslyCompoundedTimeSeriesReturnCalculator CONTINUOUS_LENIENT_CALCULATOR; static final ExcessContinuouslyCompoundedTimeSeriesReturnCalculator EXCESS_CONTINUOUS_LENIENT_CALCULATOR; static final ExcessSimpleNetTimeSeriesReturnCalculator EXCESS_SIMPLE_NET_LENIENT_CALCULATOR; static final SimpleGrossTimeSeriesReturnCalculator SIMPLE_GROSS_LENIENT_CALCULATOR; static final SimpleNetTimeSeriesReturnCalculator SIMPLE_NET_LENIENT_CALCULATOR; static final SimpleNetRelativeTimeSeriesReturnCalculator SIMPLE_NET_RELATIVE_LENIENT_CALCULATOR; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testBadCalculatorName1() { getReturnCalculator("x"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testBadCalculatorName2() { getReturnCalculator("x", CalculationMode.STRICT); }