litesoft
@ 151
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt package org.litesoft.core.simpletypes.temporal; import org.litesoft.core.simpletypes.temporal.nonpublic.*; /** * A Date resolution from the Year thru the Day. */ public final class DateRes extends AbstractRes { // Formatting Indicators public static final char INDICATOR_YEAR = 'y'; public static final char INDICATOR_MONTH = 'M'; public static final char INDICATOR_DAY = 'd'; public static final int YEARindex = 0; public static final int MONTHindex = 1; public static final int DAYindex = 2; public static DateRes ToYEAR = new DateRes( "ToYEAR", "Year", YEARindex, INDICATOR_YEAR ); public static DateRes ToMONTH = new DateRes( "ToMONTH", "Month", MONTHindex, INDICATOR_MONTH ); public static DateRes ToDAY = new DateRes( "ToDAY", "Day", DAYindex, INDICATOR_DAY ); /** * @deprecated - for Serialization */ protected DateRes() { } private DateRes( String pName, String pFriendlyName, int pIndex, char pIndicator ) { super( pName, pFriendlyName, pIndex, pIndicator ); } private static AbstractRes[] OPTIONS = new AbstractRes[]{ToYEAR, ToMONTH, ToDAY,}; public static DateRes fromIndex( int pIndex ) { return (DateRes) LLfromIndex( OPTIONS, pIndex ); } public static DateRes rehydrate( String pDesiccated ) throws IllegalArgumentException { return (DateRes) LLrehydrate( "DateRes", OPTIONS, pDesiccated ); } public boolean isValidToMonth() { return MONTHindex <= getIndex(); } public boolean isValidToDay() { return DAYindex <= getIndex(); } } |