| 753 | } |
| 754 | |
| 755 | static class Element |
| 756 | extends BasicElement<String> |
| 757 | implements TextElement<String>, ElementRule<ChronoEntity<?>, String> { |
| 758 | |
| 759 | //~ Statische Felder/Initialisierungen ---------------------------- |
| 760 | |
| 761 | private static final long serialVersionUID = 5589976208326940032L; |
| 762 | |
| 763 | //~ Instanzvariablen ---------------------------------------------- |
| 764 | |
| 765 | private transient final boolean fixed; |
| 766 | private transient final DayPeriod dayPeriod; |
| 767 | |
| 768 | //~ Konstruktoren ------------------------------------------------- |
| 769 | |
| 770 | Element( |
| 771 | boolean fixed, |
| 772 | Locale locale, |
| 773 | String calendarType |
| 774 | ) { |
| 775 | this(fixed, DayPeriod.of(locale, calendarType)); |
| 776 | |
| 777 | } |
| 778 | |
| 779 | Element( |
| 780 | boolean fixed, |
| 781 | DayPeriod dayPeriod |
| 782 | ) { |
| 783 | super(fixed ? "FIXED_DAY_PERIOD" : "APPROXIMATE_DAY_PERIOD"); |
| 784 | |
| 785 | this.fixed = fixed; |
| 786 | this.dayPeriod = dayPeriod; |
| 787 | |
| 788 | } |
| 789 | |
| 790 | //~ Methoden ------------------------------------------------------ |
| 791 | |
| 792 | @Override |
| 793 | public Class<String> getType() { |
| 794 | return String.class; |
| 795 | } |
| 796 | |
| 797 | @Override |
| 798 | public char getSymbol() { |
| 799 | return (this.fixed ? 'b' : 'B'); |
| 800 | } |
| 801 | |
| 802 | @Override |
| 803 | public String getDefaultMinimum() { |
| 804 | if (this.fixed) { |
| 805 | return "am"; |
| 806 | } |
| 807 | PlainTime key = this.dayPeriod.codeMap.firstKey(); |
| 808 | return this.dayPeriod.codeMap.get(key); |
| 809 | } |
| 810 | |
| 811 | @Override |
| 812 | public String getDefaultMaximum() { |
nothing calls this directly
no outgoing calls
no test coverage detected