package com.ycl.factory; import com.ycl.calculate.CalculationStrategy; import com.ycl.calculate.CarSiteOnlineCalculation; import java.util.HashMap; import java.util.Map; public class IndexCalculationFactory { private static final Map calculators = new HashMap<>(); static { calculators.put("siteOnline", new CarSiteOnlineCalculation()); } public static CalculationStrategy getCalculator(String indexName) { return calculators.get(indexName); } }