예제 #1
0
 public Dictionary <string, Func <ValueRange> > this[ITemporalHelper me]
 {
     get
     {
         return(new Dictionary <string, Func <ValueRange> >()
         {
             { nameof(ChronoField.YEAR), () => ((ITemporalField)ChronoField.YEAR).rangeRefinedBy(me) },
             { nameof(ChronoField.MONTH_OF_YEAR), () => ((ITemporalField)ChronoField.MONTH_OF_YEAR).rangeRefinedBy(me) },
             { nameof(ChronoField.DAY_OF_YEAR), () => ((ITemporalField)ChronoField.DAY_OF_YEAR).rangeRefinedBy(me) },
             { nameof(ChronoField.DAY_OF_WEEK), () => ((ITemporalField)ChronoField.DAY_OF_WEEK).rangeRefinedBy(me) },
             { nameof(ChronoField.DAY_OF_MONTH), () => ((ITemporalField)ChronoField.DAY_OF_MONTH).rangeRefinedBy(me) },
             { nameof(ChronoField.CLOCK_HOUR_OF_AMPM), () => ((ITemporalField)ChronoField.CLOCK_HOUR_OF_AMPM).rangeRefinedBy(me) },
             { nameof(ChronoField.CLOCK_HOUR_OF_DAY), () => ((ITemporalField)ChronoField.CLOCK_HOUR_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.HOUR_OF_DAY), () => ((ITemporalField)ChronoField.HOUR_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.HOUR_OF_AMPM), () => ((ITemporalField)ChronoField.HOUR_OF_AMPM).rangeRefinedBy(me) },
             { nameof(ChronoField.MINUTE_OF_DAY), () => ((ITemporalField)ChronoField.MINUTE_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.MINUTE_OF_HOUR), () => ((ITemporalField)ChronoField.MINUTE_OF_HOUR).rangeRefinedBy(me) },
             { nameof(ChronoField.SECOND_OF_DAY), () => ((ITemporalField)ChronoField.SECOND_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.SECOND_OF_MINUTE), () => ((ITemporalField)ChronoField.SECOND_OF_MINUTE).rangeRefinedBy(me) },
             { nameof(ChronoField.MILLI_OF_DAY), () => ((ITemporalField)ChronoField.MILLI_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.MILLI_OF_SECOND), () => ((ITemporalField)ChronoField.MILLI_OF_SECOND).rangeRefinedBy(me) },
             { nameof(ChronoField.MICRO_OF_DAY), () => ((ITemporalField)ChronoField.MICRO_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.MICRO_OF_SECOND), () => ((ITemporalField)ChronoField.MICRO_OF_SECOND).rangeRefinedBy(me) },
             { nameof(ChronoField.NANO_OF_DAY), () => ((ITemporalField)ChronoField.NANO_OF_DAY).rangeRefinedBy(me) },
             { nameof(ChronoField.NANO_OF_SECOND), () => ((ITemporalField)ChronoField.NANO_OF_SECOND).rangeRefinedBy(me) }
         });
     }
 }
예제 #2
0
 public static bool isSupported(ITemporalHelper me, ITemporalField field)
 {
     if (field is ChronoField)
     {
         return(isSupported(me.isSupportedHandlers, (ChronoField)field));
     }
     throw new ArgumentException("Invalid argument type", nameof(field));
 }
예제 #3
0
 public static bool isSupported(ITemporalHelper me, ITemporalUnit unit)
 {
     if (unit is ChronoUnit)
     {
         return(isSupported(me.isSupportedHandlers, (ChronoUnit)unit));
     }
     throw new ArgumentException("Invalid argument type", nameof(unit));
 }
예제 #4
0
        public static int get(ITemporalHelper me, ITemporalField field)
        {
            int?rslt = getIntFromLong(getLong(me, field));

            if (rslt.HasValue)
            {
                return(rslt.Value);
            }
            throw new ArgumentException("Invalid argument type", nameof(field));
        }
예제 #5
0
 public static long getLong(ITemporalHelper me, ITemporalField field)
 {
     if (field is ChronoField)
     {
         long?rslt = get(me.getHandlers, (ChronoField)field);
         if (rslt.HasValue)
         {
             return(rslt.Value);
         }
     }
     throw new ArgumentException("Invalid argument type", nameof(field));
 }
예제 #6
0
 public static ValueRange range(ITemporalHelper me, ITemporalField field)
 {
     if (field is ChronoField)
     {
         ValueRange rslt = range(rangeHandlers[me], (ChronoField)field);
         if (rslt != null)
         {
             return(rslt);
         }
     }
     throw new ArgumentException("Invalid argument type", nameof(field));
 }
예제 #7
0
 public static ITemporal adjustInto(ITemporalHelper me, ITemporal temporal)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 public static R query <V, R>(ITemporalHelper me, Func <V, R> del) where V : ITemporalAccessor
 {
     return(del((V)(ITemporalAccessor)me));
 }
예제 #9
0
 public static ITemporal with(ITemporalHelper me, ITemporalField field, long newValue)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public static ITemporal with(ITemporalHelper me, ITemporalAdjuster adjuster)
 {
     throw new NotImplementedException();
 }
예제 #11
0
 public static long until(ITemporalHelper me, ITemporal endExclusive, ITemporalUnit unit)
 {
     return(unit.between(me, endExclusive));
 }
예제 #12
0
 public static ITemporal plus(ITemporalHelper me, ITemporalAmount amount)
 {
     return(plus(me.addSubrtactHandlers, amount));
 }
예제 #13
0
 public static ITemporal plus(ITemporalHelper me, long amountToAdd, ITemporalUnit unit)
 {
     return(((ITemporal)me).plus(new Duration(amountToAdd, unit)));
 }
예제 #14
0
 public static ITemporal minus(ITemporalHelper me, long amountToSubtract, ITemporalUnit unit)
 {
     return(((ITemporal)me).minus(new Duration(amountToSubtract, unit)));
 }