| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
package com.ibm.icu.impl; |
| 9 |
|
|
| 10 |
|
import java.util.MissingResourceException; |
| 11 |
|
|
| 12 |
|
import com.ibm.icu.util.ULocale; |
| 13 |
|
import com.ibm.icu.util.UResourceBundle; |
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
|
|
|
| 87% |
Uncovered Elements: 6 (46) |
Complexity: 19 |
Complexity Density: 0.68 |
|
| 21 |
|
public class CalendarData { |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
@param |
| 25 |
|
@param |
| 26 |
|
|
| 27 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 28 |
10913
|
public CalendarData(ULocale loc, String type) {... |
| 29 |
10913
|
this((ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, loc), type); |
| 30 |
|
} |
| 31 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 32 |
10914
|
public CalendarData(ICUResourceBundle b, String type) {... |
| 33 |
10914
|
fBundle = b; |
| 34 |
10914
|
if((type == null) || (type.equals("")) || (type.equals("gregorian"))) { |
| 35 |
10613
|
fMainType = "gregorian"; |
| 36 |
10613
|
fFallbackType = null; |
| 37 |
|
} else { |
| 38 |
301
|
fMainType = type; |
| 39 |
301
|
fFallbackType ="gregorian"; |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@param |
| 47 |
|
|
| 48 |
|
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 49 |
12877
|
public ICUResourceBundle get(String key) {... |
| 50 |
12877
|
try { |
| 51 |
12877
|
return fBundle.getWithFallback("calendar/" + fMainType + "/" + key); |
| 52 |
|
} catch(MissingResourceException m) { |
| 53 |
377
|
if(fFallbackType != null) { |
| 54 |
377
|
return fBundle.getWithFallback("calendar/" + fFallbackType + "/" + key); |
| 55 |
|
} |
| 56 |
0
|
throw m; |
| 57 |
|
|
| 58 |
|
} |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
@param |
| 68 |
|
@param |
| 69 |
|
|
| 70 |
|
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 71 |
4168
|
public ICUResourceBundle get(String key, String subKey) {... |
| 72 |
4168
|
try { |
| 73 |
4168
|
return fBundle.getWithFallback("calendar/" + fMainType + "/" + key + "/format/" + subKey); |
| 74 |
|
} catch(MissingResourceException m) { |
| 75 |
226
|
if(fFallbackType != null) { |
| 76 |
226
|
return fBundle.getWithFallback("calendar/" + fFallbackType + "/" + key + "/format/" + subKey); |
| 77 |
|
} |
| 78 |
0
|
throw m; |
| 79 |
|
|
| 80 |
|
} |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
|
| 88 |
|
@param |
| 89 |
|
@param |
| 90 |
|
@param |
| 91 |
|
|
| 92 |
|
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 93 |
4185
|
public ICUResourceBundle get(String key, String contextKey, String subKey) {... |
| 94 |
4185
|
try { |
| 95 |
4185
|
return fBundle.getWithFallback("calendar/" + fMainType + "/" + key + "/" + contextKey + "/" + subKey); |
| 96 |
|
} catch(MissingResourceException m) { |
| 97 |
722
|
if(fFallbackType != null) { |
| 98 |
722
|
return fBundle.getWithFallback("calendar/" + fFallbackType + "/" + key + "/" + contextKey + "/" + subKey); |
| 99 |
|
} |
| 100 |
0
|
throw m; |
| 101 |
|
|
| 102 |
|
} |
| 103 |
|
} |
| 104 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 105 |
603
|
public String[] getStringArray(String key) {... |
| 106 |
603
|
return get(key).getStringArray(); |
| 107 |
|
} |
| 108 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 109 |
4168
|
public String[] getStringArray(String key, String subKey) {... |
| 110 |
4168
|
return get(key, subKey).getStringArray(); |
| 111 |
|
} |
| 112 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 113 |
4168
|
public String[] getStringArray(String key, String contextKey, String subKey) {... |
| 114 |
4168
|
return get(key, contextKey, subKey).getStringArray(); |
| 115 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 116 |
1563
|
public String[] getEras(String subkey){... |
| 117 |
1563
|
ICUResourceBundle bundle = get("eras/"+subkey); |
| 118 |
1563
|
return bundle.getStringArray(); |
| 119 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 120 |
338
|
public ULocale getULocale() {... |
| 121 |
338
|
return fBundle.getULocale(); |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
private ICUResourceBundle fBundle; |
| 125 |
|
private String fMainType; |
| 126 |
|
private String fFallbackType; |
| 127 |
|
} |