43 import java.util.Set;
44 import java.util.TreeMap;
45 import java.util.TreeSet;
46 import java.util.concurrent.ConcurrentHashMap;
47 import java.time.*;
48 import java.time.Year;
49 import java.time.chrono.IsoChronology;
50 import java.time.temporal.TemporalAdjusters;
51 import java.time.zone.ZoneOffsetTransition;
52 import java.time.zone.ZoneOffsetTransitionRule;
53 import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
54 import java.time.zone.ZoneRulesException;
55
56 /**
57 * Compile and build time-zone rules from IANA timezone data
58 *
59 * @author Xueming Shen
60 * @author Stephen Colebourne
61 * @author Michael Nascimento Santos
62 *
63 * @since 1.9
64 */
65
66 class TzdbZoneRulesProvider {
67
68 /**
69 * Creates an instance.
70 *
71 * @throws ZoneRulesException if unable to load
72 */
73 public TzdbZoneRulesProvider(List<Path> files) {
74 try {
75 load(files);
76 } catch (Exception ex) {
77 throw new ZoneRulesException("Unable to load TZDB time-zone rules", ex);
78 }
79 }
80
81 public Set<String> getZoneIds() {
82 return new TreeSet(regionIds);
83 }
|
43 import java.util.Set;
44 import java.util.TreeMap;
45 import java.util.TreeSet;
46 import java.util.concurrent.ConcurrentHashMap;
47 import java.time.*;
48 import java.time.Year;
49 import java.time.chrono.IsoChronology;
50 import java.time.temporal.TemporalAdjusters;
51 import java.time.zone.ZoneOffsetTransition;
52 import java.time.zone.ZoneOffsetTransitionRule;
53 import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
54 import java.time.zone.ZoneRulesException;
55
56 /**
57 * Compile and build time-zone rules from IANA timezone data
58 *
59 * @author Xueming Shen
60 * @author Stephen Colebourne
61 * @author Michael Nascimento Santos
62 *
63 * @since 9
64 */
65
66 class TzdbZoneRulesProvider {
67
68 /**
69 * Creates an instance.
70 *
71 * @throws ZoneRulesException if unable to load
72 */
73 public TzdbZoneRulesProvider(List<Path> files) {
74 try {
75 load(files);
76 } catch (Exception ex) {
77 throw new ZoneRulesException("Unable to load TZDB time-zone rules", ex);
78 }
79 }
80
81 public Set<String> getZoneIds() {
82 return new TreeSet(regionIds);
83 }
|