Tabnine Logo
Holiday
Code IndexAdd Tabnine to your IDE (free)

How to use
Holiday
in
de.jollyday.config

Best Java code snippets using de.jollyday.config.Holiday (Showing top 11 results out of 315)

origin: stanfordnlp/CoreNLP

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;
}
origin: de.jollyday/jollyday

/**
 * Checks whether the holiday is within the valid date range.
 *
 * @param h the holiday to check for validity
 * @param year the year to check the holiday to be valid in
 * @return the holiday is valid
 */
private <T extends Holiday> boolean isValidInYear(T h, int year) {
  return (h.getValidFrom() == null || h.getValidFrom() <= year)
      && (h.getValidTo() == null || h.getValidTo() >= year);
}
origin: de.jollyday/jollyday

if (h.getEvery() != null) {
  if (!EVERY_YEAR.equals(h.getEvery())) {
    if (ODD_YEARS.equals(h.getEvery())) {
      return year % 2 != 0;
    } else if (EVEN_YEARS.equals(h.getEvery())) {
      return year % 2 == 0;
    } else {
      if (h.getValidFrom() != null) {
        int cycleYears;
        if (TWO_YEARS.equalsIgnoreCase(h.getEvery())) {
          cycleYears = 2;
        } else if (THREE_YEARS.equalsIgnoreCase(h.getEvery())) {
          cycleYears = 3;
        } else if (FOUR_YEARS.equalsIgnoreCase(h.getEvery())) {
          cycleYears = 4;
        } else if (FIVE_YEARS.equalsIgnoreCase(h.getEvery())) {
          cycleYears = 5;
        } else if (SIX_YEARS.equalsIgnoreCase(h.getEvery())) {
          cycleYears = 6;
        } else {
          throw new IllegalArgumentException("Cannot handle unknown cycle type '" + h.getEvery()
              + "'.");
        return (year - h.getValidFrom()) % cycleYears == 0;
origin: stanfordnlp/CoreNLP

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;
}
origin: stanfordnlp/CoreNLP

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;
}
origin: edu.stanford.nlp/stanford-corenlp

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;
}
origin: com.guokr/stan-cn-com

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;
}
origin: edu.stanford.nlp/stanford-corenlp

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;
}
origin: com.guokr/stan-cn-com

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;
}
origin: edu.stanford.nlp/stanford-corenlp

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;
}
origin: com.guokr/stan-cn-com

@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;
}
de.jollyday.configHoliday

Javadoc

Java-Klasse für Holiday complex type.

Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.

 
<complexType name="Holiday"> 
<complexContent> 
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
<attribute name="validFrom" type="{http://www.w3.org/2001/XMLSchema}int" /> 
<attribute name="validTo" type="{http://www.w3.org/2001/XMLSchema}int" /> 
<attribute name="every" type="{http://www.example.org/Holiday}HolidayCycleType" default="EVERY_YEAR" /> 
<attribute name="descriptionPropertiesKey" type="{http://www.w3.org/2001/XMLSchema}string" /> 
<attribute name="localizedType" type="{http://www.example.org/Holiday}HolidayType" default="OFFICIAL_HOLIDAY" /> 
</restriction> 
</complexContent> 
</complexType> 

Most used methods

  • getDescriptionPropertiesKey
    Ruft den Wert der descriptionPropertiesKey-Eigenschaft ab.
  • getEvery
    Ruft den Wert der every-Eigenschaft ab.
  • getValidFrom
    Ruft den Wert der validFrom-Eigenschaft ab.
  • getValidTo
    Ruft den Wert der validTo-Eigenschaft ab.

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • Kernel (java.awt.image)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JOptionPane (javax.swing)
  • Join (org.hibernate.mapping)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now