| 1757 | } |
| 1758 | |
| 1759 | private static class BWRule<T extends ChronoEntity<T>> |
| 1760 | implements ElementRule<T, Integer> { |
| 1761 | |
| 1762 | //~ Instanzvariablen ---------------------------------------------- |
| 1763 | |
| 1764 | private final CalendarWeekElement owner; |
| 1765 | |
| 1766 | //~ Konstruktoren ------------------------------------------------- |
| 1767 | |
| 1768 | private BWRule(CalendarWeekElement owner) { |
| 1769 | super(); |
| 1770 | |
| 1771 | this.owner = owner; |
| 1772 | |
| 1773 | } |
| 1774 | |
| 1775 | //~ Methoden ------------------------------------------------------ |
| 1776 | |
| 1777 | @Override |
| 1778 | public Integer getValue(T context) { |
| 1779 | |
| 1780 | PlainDate date = context.get(CALENDAR_DATE); |
| 1781 | return Integer.valueOf(this.getWeek(date)); |
| 1782 | |
| 1783 | } |
| 1784 | |
| 1785 | @Override |
| 1786 | public Integer getMinimum(T context) { |
| 1787 | |
| 1788 | PlainDate date = context.get(CALENDAR_DATE); |
| 1789 | return Integer.valueOf(this.getMinWeek(date)); |
| 1790 | |
| 1791 | } |
| 1792 | |
| 1793 | @Override |
| 1794 | public Integer getMaximum(T context) { |
| 1795 | |
| 1796 | PlainDate date = context.get(CALENDAR_DATE); |
| 1797 | return Integer.valueOf(this.getMaxWeek(date)); |
| 1798 | |
| 1799 | } |
| 1800 | |
| 1801 | @Override |
| 1802 | public ChronoElement<?> getChildAtFloor(T context) { |
| 1803 | |
| 1804 | return this.getChild(context, false); |
| 1805 | |
| 1806 | } |
| 1807 | |
| 1808 | @Override |
| 1809 | public ChronoElement<?> getChildAtCeiling(T context) { |
| 1810 | |
| 1811 | return this.getChild(context, true); |
| 1812 | |
| 1813 | } |
| 1814 | |
| 1815 | private ChronoElement<?> getChild( |
| 1816 | T context, |
nothing calls this directly
no outgoing calls
no test coverage detected