コード例 #1
0
  /**
   * @param dayDataMap
   * @param count
   * @param tripCategory
   * @param dow
   */
  private void populateRoamersCountDoW(
      final Map<RoamerType, Map<DayOfWeek, Double>> dayDataMap,
      final Double count,
      final Integer tripCategory,
      final DayOfWeek dow) {
    Map<DayOfWeek, Double> dayRoamerTypeMap = dayDataMap.get(RoamerType.of(tripCategory));
    if (dayRoamerTypeMap == null) {
      dayRoamerTypeMap = new TreeMap<DayOfWeek, Double>();
      dayDataMap.put(RoamerType.of(tripCategory), dayRoamerTypeMap);
    }

    final Double dayData = dayRoamerTypeMap.get(dow);
    if (dayData == null) {
      dayRoamerTypeMap.put(dow, count);
    } else {
      dayRoamerTypeMap.put(dow, count + dayData);
    }
  }
コード例 #2
0
  /**
   * @param dateDataMap
   * @param date
   * @param count
   * @param tripCategory
   */
  private void populateRoamersCountPerDay(
      final Map<RoamerType, Map<Long, Double>> dateDataMap,
      final Long date,
      final Double count,
      final Integer tripCategory) {
    Map<Long, Double> dateRoamerTypeMap = dateDataMap.get(RoamerType.of(tripCategory));

    if (dateRoamerTypeMap == null) {
      dateRoamerTypeMap = new TreeMap<Long, Double>();
      dateDataMap.put(RoamerType.of(tripCategory), dateRoamerTypeMap);
    }

    final Double dateData = dateRoamerTypeMap.get(date);
    if (dateData == null) {
      dateRoamerTypeMap.put(date, count);
    } else {
      dateRoamerTypeMap.put(date, count + dateData);
    }
  }