/* * [LincolnsBirthday.java] * * Summary: calculate when Lincoln's birthday occurs. * * Copyright: (c) 1999-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 4.2 2008-12-03 add World AIDS day */ package com.mindprod.holidays; import com.mindprod.common18.BigDate; /** * calculate when Lincoln's birthday occurs. * * @author Roedy Green, Canadian Mind Products * @version 4.2 2008-12-03 add World AIDS day * @since 1999 */ public final class LincolnsBirthday extends HolInfo { /** * @inheritDoc */ public String getAuthority() { return ""; } /** * @inheritDoc */ public int getFirstYear( int base ) { switch ( base ) { default: case OBSERVED: return 1809;// his birthday case PROCLAIMED: return 1809;// not known ?? } } /** * @inheritDoc */ public String getName() { return "Lincoln\u2019s Birthday"; } /** * @inheritDoc */ public String getRule() { return "always on February 12, replaced by Presidents Day in 1971"; } /** * @inheritDoc */ public int when( int year, boolean shift, int base ) { if ( !isYearValid( year, base ) || ( base == PROCLAIMED && year >= 1971 ) ) { return BigDate.NULL_ORDINAL; } return shiftSatToFriSunToMon( BigDate.toOrdinal( year, 2, 12 ), shift ); } // end when. }