public Map<String, JollyHoliday> getAllHolidaysMap(Set<de.jollyday.config.Holiday> allHolidays) { Map<String, JollyHoliday> map = Generics.newHashMap(); for (de.jollyday.config.Holiday h : allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.put(jh.label, jh); } } return map; }
public CollectionValuedMap<String, JollyHoliday> getAllHolidaysCVMap(Set<de.jollyday.config.Holiday> allHolidays) { CollectionValuedMap<String, JollyHoliday> map = new CollectionValuedMap<>(); for (de.jollyday.config.Holiday h:allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.add(jh.label, jh); } } return map; }
private SUTime.Time resolveWithYear(int year) { // TODO: If we knew location of article, can use that information to resolve holidays better Set<de.jollyday.Holiday> holidays = holidayManager.getHolidays(year); // Try to find this holiday for (de.jollyday.Holiday h : holidays) { if (h.getPropertiesKey().equals(base.getDescriptionPropertiesKey())) { return new SUTime.PartialTime(this, new Partial(h.getDate())); } } return null; }
public Map<String, JollyHoliday> getAllHolidaysMap(Set<de.jollyday.config.Holiday> allHolidays) { Map<String, JollyHoliday> map = Generics.newHashMap(); for (de.jollyday.config.Holiday h : allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.put(jh.label, jh); } } return map; }
public Map<String, JollyHoliday> getAllHolidaysMap(Set<de.jollyday.config.Holiday> allHolidays) { Map<String, JollyHoliday> map = Generics.newHashMap(); for (de.jollyday.config.Holiday h:allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.put(jh.label, jh); } } return map; }
public CollectionValuedMap<String, JollyHoliday> getAllHolidaysCVMap(Set<de.jollyday.config.Holiday> allHolidays) { CollectionValuedMap<String, JollyHoliday> map = new CollectionValuedMap<>(); for (de.jollyday.config.Holiday h:allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.add(jh.label, jh); } } return map; }
public CollectionValuedMap<String, JollyHoliday> getAllHolidaysCVMap(Set<de.jollyday.config.Holiday> allHolidays) { CollectionValuedMap<String, JollyHoliday> map = new CollectionValuedMap<String, JollyHoliday>(); for (de.jollyday.config.Holiday h:allHolidays) { String descKey = h.getDescriptionPropertiesKey(); if (descKey != null) { descKey = descKey.replaceAll(".*\\.",""); JollyHoliday jh = new JollyHoliday(descKey, holidayManager, h); map.add(jh.label, jh); } } return map; }
private SUTime.Time resolveWithYear(int year) { // TODO: If we knew location of article, can use that information to resolve holidays better Set<de.jollyday.Holiday> holidays = holidayManager.getHolidays(year); // Try to find this holiday for (de.jollyday.Holiday h : holidays) { if (h.getPropertiesKey().equals(base.getDescriptionPropertiesKey())) { return new SUTime.PartialTime(this, new Partial(h.getDate())); } } return null; }
@Override public SUTime.Time resolve(SUTime.Time t, int flags) { Partial p = (t != null)? t.getJodaTimePartial():null; if (p != null) { if (JodaTimeUtils.hasField(p, DateTimeFieldType.year())) { int year = p.get(DateTimeFieldType.year()); // TODO: If we knew location of article, can use that information to resolve holidays better Set<de.jollyday.Holiday> holidays = holidayManager.getHolidays(year); // Try to find this holiday for (de.jollyday.Holiday h:holidays) { if (h.getPropertiesKey().equals(base.getDescriptionPropertiesKey())) { return new SUTime.PartialTime(this, new Partial(h.getDate())); } } } } return this; }