-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathDateSymbolJyLocale.java
More file actions
51 lines (41 loc) · 1.37 KB
/
DateSymbolJyLocale.java
File metadata and controls
51 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.python.modules._locale;
import java.text.DateFormatSymbols;
import java.util.Locale;
/**
* Separating these largely constant values from Python encoding conversions allows for safer
* initialization even if modules are loaded in different orders. The Python {@code locale} and
* {@code codecs} modules have interdependencies, as well as {@link org.python.modules.time.Time}
* and {@link org.python.modules._locale._locale}. The latter in particular depends on
* {@code java.util.Locale} and this class, but only uses the date symbol aspect.
*
* @since Jython 2.7.2
*/
public class DateSymbolJyLocale implements DateSymbolLocale {
protected final Locale locale;
protected final DateFormatSymbols dfSymbols;
public DateSymbolJyLocale(Locale locale) {
super();
this.locale = locale;
this.dfSymbols = DateFormatSymbols.getInstance(locale);
}
@Override
public String[] getShortWeekdays() {
return dfSymbols.getShortWeekdays();
}
@Override
public String[] getWeekdays() {
return dfSymbols.getWeekdays();
}
@Override
public String[] getShortMonths() {
return dfSymbols.getShortMonths();
}
@Override
public String[] getMonths() {
return dfSymbols.getMonths();
}
@Override
public String[] getAmPmStrings() {
return dfSymbols.getAmPmStrings();
}
}