View Javadoc

1   /*
2    *  File: HolidayEnumerator_fr_FR.java 
3    *  Copyright (c) 2004-2007  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Common Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/cpl-v10.html
10   */
11  package de.jaret.util.date.holidayenumerator;
12  
13  import java.util.Locale;
14  
15  /**
16   * HolidayEnumerator for France. (Enumerator pour les jours feriÔøΩ en france) Information from
17   * http://fr.wikipedia.org/wiki/Jour_f%C3%A9ri%C3%A9 <b>No warranty!</b>
18   * 
19   * @author Peter Kliem
20   * @version $Id: HolidayEnumerator_fr_FR.java 293 2007-03-11 17:50:57Z olk $
21   */
22  public class HolidayEnumerator_fr_FR extends HolidayEnumeratorBase {
23      /** Region central france; default. */
24      public static final String REGION_CENTRAL = "CEN";
25      /** Region alsace, equivivalent to modelle. */
26      public static final String REGION_ALSACE = "ALS";
27      /** Region moselle, equivalent to alsace. */
28      public static final String REGION_MOSELLE = "MOS";
29  
30      /** all regions. */
31      private static final String[] REGIONIDS = {REGION_CENTRAL, REGION_ALSACE, REGION_MOSELLE};
32      
33      /**
34       * This HolidayEnumerator is always bound to the locale fr_FR.
35       * 
36       * @param regionId additional regionId defined as constants or <code>null</code> for default.
37       */
38      public HolidayEnumerator_fr_FR(String regionId) {
39          _regionId = regionId;
40          _locale = Locale.FRANCE;
41      }
42  
43      /**
44       * {@inheritDoc}
45       */
46      public String[] getAvailableRegionIds() {
47          return REGIONIDS;
48      }
49      
50      /**
51       * {@inheritDoc}
52       */
53      protected void fillMap(int year) {
54          addNamedDate(year, 0, 1, true, "Jour de l'an");
55  
56          addNamedDate(year, 4, 1, true, "FÔøΩte du Travail");
57  
58          addNamedDate(year, 4, 8, true, "Victoire de 1945");
59  
60          addNamedDate(year, 6, 14, true, "FÔøΩte nationale");
61  
62          addNamedDate(year, 7, 15, true, "Assomption");
63  
64          addNamedDate(year, 10, 1, true, "La toussaint");
65  
66          addNamedDate(year, 10, 11, true, "Armistice 1918");
67  
68          addNamedDate(year, 11, 25, true, "NoÔøΩl");
69          if (_regionId != null && (_regionId.equals(REGION_ALSACE) || _regionId.equals(REGION_MOSELLE))) {
70              addNamedDate(year, 11, 26, true, "Saint ÔøΩtienne");
71          } else {
72              addNamedDate(year, 11, 26, false, "Saint ÔøΩtienne");
73          }
74  
75          // easter days
76          EasyDate ed = calcEaster(year);
77          addNamedDate(year, ed.month, ed.day, true, "PÔøΩques");
78          addNamedDate(year, ed.month, ed.day, 1, true, "Lundi de PÔøΩques");
79          if (_regionId != null && (_regionId.equals(REGION_ALSACE) || _regionId.equals(REGION_MOSELLE))) {
80              addNamedDate(year, ed.month, ed.day, -2, true, "Vendredi saint");
81          } else {
82              addNamedDate(year, ed.month, ed.day, -2, false, "Vendredi saint");
83          }
84  
85          // Ascension
86          addNamedDate(year, ed.month, ed.day, 39, true, "Ascension");
87  
88          // PentecÔøΩte
89          addNamedDate(year, ed.month, ed.day, 49, true, "PentecÔøΩte");
90  
91      }
92  
93  }