382 Objects.requireNonNull(chrono, "chrono");
383 currentParsed().chrono = chrono;
384 if (chronoListeners != null && !chronoListeners.isEmpty()) {
385 @SuppressWarnings({"rawtypes", "unchecked"})
386 Consumer<Chronology>[] tmp = new Consumer[1];
387 Consumer<Chronology>[] listeners = chronoListeners.toArray(tmp);
388 chronoListeners.clear();
389 for (Consumer<Chronology> l : listeners) {
390 l.accept(chrono);
391 }
392 }
393 }
394
395 /**
396 * Adds a Consumer<Chronology> to the list of listeners to be notified
397 * if the Chronology changes.
398 * @param listener a Consumer<Chronology> to be called when Chronology changes
399 */
400 void addChronoChangedListener(Consumer<Chronology> listener) {
401 if (chronoListeners == null) {
402 chronoListeners = new ArrayList<Consumer<Chronology>>();
403 }
404 chronoListeners.add(listener);
405 }
406
407 /**
408 * Stores the parsed zone.
409 * <p>
410 * This stores the zone that has been parsed.
411 * No validation is performed other than ensuring it is not null.
412 *
413 * @param zone the parsed zone, not null
414 */
415 void setParsed(ZoneId zone) {
416 Objects.requireNonNull(zone, "zone");
417 currentParsed().zone = zone;
418 }
419
420 /**
421 * Stores the parsed leap second.
422 */
|
382 Objects.requireNonNull(chrono, "chrono");
383 currentParsed().chrono = chrono;
384 if (chronoListeners != null && !chronoListeners.isEmpty()) {
385 @SuppressWarnings({"rawtypes", "unchecked"})
386 Consumer<Chronology>[] tmp = new Consumer[1];
387 Consumer<Chronology>[] listeners = chronoListeners.toArray(tmp);
388 chronoListeners.clear();
389 for (Consumer<Chronology> l : listeners) {
390 l.accept(chrono);
391 }
392 }
393 }
394
395 /**
396 * Adds a Consumer<Chronology> to the list of listeners to be notified
397 * if the Chronology changes.
398 * @param listener a Consumer<Chronology> to be called when Chronology changes
399 */
400 void addChronoChangedListener(Consumer<Chronology> listener) {
401 if (chronoListeners == null) {
402 chronoListeners = new ArrayList<>();
403 }
404 chronoListeners.add(listener);
405 }
406
407 /**
408 * Stores the parsed zone.
409 * <p>
410 * This stores the zone that has been parsed.
411 * No validation is performed other than ensuring it is not null.
412 *
413 * @param zone the parsed zone, not null
414 */
415 void setParsed(ZoneId zone) {
416 Objects.requireNonNull(zone, "zone");
417 currentParsed().zone = zone;
418 }
419
420 /**
421 * Stores the parsed leap second.
422 */
|