/** * @param dowCallMap * @param perDayCallMap * @param dowCategory * @param dateCategory * @param roamingTrend */ private void populateVoiceCallChart( final Map<VoiceType, Map<DayOfWeek, Double>> dowCallMap, final Map<VoiceType, Map<Long, Double>> perDayCallMap, final Set<DayOfWeek> dowCategory, final Set<Long> dateCategory, final RoamingTrend roamingTrend, final long startDate) { final List<ChartSeries> dowCallSeriesList = new ArrayList<ChartSeries>(); for (final VoiceType voiceType : dowCallMap.keySet()) { final ChartSeries series = new ChartSeries(); series.setName(voiceType.name()); series.setData(dowCallMap.get(voiceType).values()); dowCallSeriesList.add(series); } final List<ChartSeries> perDayCallSeriesList = new ArrayList<ChartSeries>(); for (final VoiceType voiceType : perDayCallMap.keySet()) { final PerDaySeries series = new PerDaySeries(); series.setName(voiceType.name()); series.setPointStart(startDate); series.setData(perDayCallMap.get(voiceType).values()); perDayCallSeriesList.add(series); } final RoamingTrendChart voiceChart = new RoamingTrendChart(); voiceChart.setDowCategoryList(dowCategory); // voiceChart.setPerDayCategoryList(dateCategory); voiceChart.setDowSeriesList(dowCallSeriesList); voiceChart.setPerDaySeriesList(perDayCallSeriesList); roamingTrend.setRoamersMTMOChart(voiceChart); }
/** @author sarvesh */ public enum VoiceType { MT, MO; private static final VoiceType[] ENUMS = VoiceType.values(); public static VoiceType of(int type) { if (type < 1 || type > 2) { throw new ApplicationException( "Invalid value for roamer type: " + type, new IllegalArgumentException()); } return ENUMS[type - 1]; } }