TimeSeriesReturnCalculatorFactory { public static String getReturnCalculatorName(final TimeSeriesReturnCalculator calculator) { if (calculator == null) { return null; } final CalculationMode mode = calculator.getMode(); if (mode == CalculationMode.STRICT) { return s_instanceStrictNames.get(calculator.getClass()); } else if (mode == CalculationMode.LENIENT) { return s_instanceLenientNames.get(calculator.getClass()); } else { throw new IllegalArgumentException("Do not have calculator for " + calculator.getClass().getName() + " with calculation mode " + mode); } }  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 public void testNullCalculator1() { assertNull(getReturnCalculatorName(null)); }
@Test public void testNullCalculator2() { assertNull(getReturnCalculatorName(null, CalculationMode.STRICT)); }