Javalanche report for class:
org.joda.time.DateMidnight
1: /*
2: * Copyright 2001-2011 Stephen Colebourne
3: *
4: * Licensed under the Apache License, Version 2.0 (the "License");
5: * you may not use this file except in compliance with the License.
6: * You may obtain a copy of the License at
7: *
8: * http://www.apache.org/licenses/LICENSE-2.0
9: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.joda.time;
17:
18: import java.io.IOException;
19: import java.io.ObjectInputStream;
20: import java.io.ObjectOutputStream;
21: import java.io.Serializable;
22: import java.util.Locale;
23:
24: import org.joda.convert.FromString;
25: import org.joda.time.base.BaseDateTime;
26: import org.joda.time.field.AbstractReadableInstantFieldProperty;
27: import org.joda.time.format.DateTimeFormatter;
28: import org.joda.time.format.ISODateTimeFormat;
29:
30: /**
31: * DateMidnight defines a date where the time component is fixed at midnight.
32: * The class uses a time zone, thus midnight is local unless a UTC time zone is used.
33: *

34: * It is important to emphasise that this class represents the time of midnight on
35: * any given day.
36: * Note that midnight is defined as 00:00, which is at the very start of a day.
37: *

38: * This class does not represent a day, but the millisecond instant at midnight.
39: * If you need a class that represents the whole day, then an {@link Interval} or
40: * a {@link LocalDate} may be more suitable.
41: *

42: * This class uses a Chronology internally. The Chronology determines how the
43: * millisecond instant value is converted into the date time fields.
44: * The default Chronology is ISOChronology which is the agreed
45: * international standard and compatable with the modern Gregorian calendar.
46: *
47: *
Each individual field can be queried in two ways:
48: *

49: *
getDayOfMonth()
50: *
dayOfMonth().get()
51: *

52: * The second technique also provides access to other useful methods on the
53: * field:
54: *

55: *
numeric value
56: *
text value
57: *
short text value
58: *
maximum/minimum values
59: *
add/subtract
60: *
set
61: *
rounding
62: *

63: *
64: *

65: * DateMidnight is thread-safe and immutable, provided that the Chronology is as well.
66: * All standard Chronology classes supplied are thread-safe and immutable.
67: *
68: * @author Stephen Colebourne
69: * @since 1.0
70: */
71: public final class DateMidnight
72: extends BaseDateTime
73: implements ReadableDateTime, Serializable {
74:
75: /** Serialization lock */
76: private static final long serialVersionUID =<PHONE_NUMBER>18738L;
77:
78: //-----------------------------------------------------------------------
79: /**
80: * Obtains a {@code DateMidnight} set to the current system millisecond time
81: * using ISOChronology in the default time zone.
82: * The constructed object will have a local time of midnight.
83: *
84: * @return the current date, not null
85: * @since 2.0
86: */
87: public static DateMidnight now() {
88: return new DateMidnight();
89: }
90:
91: /**
92: * Obtains a {@code DateMidnight} set to the current system millisecond time
93: * using ISOChronology in the specified time zone.
94: * The constructed object will have a local time of midnight.
95: *
96: * @param zone the time zone, not null
97: * @return the current date, not null
98: * @since 2.0
99: */
100: public static DateMidnight now(DateTimeZone zone) {
101: if (zone == null) {
102: throw new NullPointerException("Zone must not be null");
103: }
104: return new DateMidnight(zone);
105: }
106:
107: /**
108: * Obtains a {@code DateMidnight} set to the current system millisecond time
109: * using the specified chronology.
110: * The constructed object will have a local time of midnight.
111: *
112: * @param chronology the chronology, not null
113: * @return the current date, not null
114: * @since 2.0
115: */
116: public static DateMidnight now(Chronology chronology) {
117: if (chronology == null) {
118: throw new NullPointerException("Chronology must not be null");
119: }
120: return new DateMidnight(chronology);
121: }
122:
123: //-----------------------------------------------------------------------
124: /**
125: * Parses a {@code DateMidnight} from the specified string.
126: *

127: * This uses {@link ISODateTimeFormat#dateTimeParser()}.
128: *
129: * @param str the string to parse, not null
130: * @since 2.0
131: */
132: @FromString
133: public static DateMidnight parse(String str) {
134: return parse(str, ISODateTimeFormat.dateTimeParser().withOffsetParsed());
135: }
136:
137: /**
138: * Parses a {@code DateMidnight} from the specified string using a formatter.
139: *
140: * @param str the string to parse, not null
141: * @param formatter the formatter to use, not null
142: * @since 2.0
143: */
144: public static DateMidnight parse(String str, DateTimeFormatter formatter) {
145: return formatter.parseDateTime(str).toDateMidnight();
146: }
147:
148: //-----------------------------------------------------------------------
149: /**
150: * Constructs an instance set to the current system millisecond time
151: * using ISOChronology in the default time zone.
152: * The constructed object will have a local time of midnight.
153: *
154: * @see #now()
155: */
156: public DateMidnight() {
157: super();
158: }
159:
160: /**
161: * Constructs an instance set to the current system millisecond time
162: * using ISOChronology in the specified time zone.
163: * The constructed object will have a local time of midnight.
164: *

165: * If the specified time zone is null, the default zone is used.
166: *
167: * @param zone the time zone, null means default zone
168: * @see #now(DateTimeZone)
169: */
170: public DateMidnight(DateTimeZone zone) {
171: super(zone);
172: }
173:
174: /**
175: * Constructs an instance set to the current system millisecond time
176: * using the specified chronology.
177: * The constructed object will have a local time of midnight.
178: *

179: * If the chronology is null, ISOChronology
180: * in the default time zone is used.
181: *
182: * @param chronology the chronology, null means ISOChronology in default zone
183: * @see #now(Chronology)
184: */
185: public DateMidnight(Chronology chronology) {
186: super(chronology);
187: }
188:
189: //-----------------------------------------------------------------------
190: /**
191: * Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
192: * using ISOChronology in the default time zone.
193: * The constructed object will have a local time of midnight.
194: *
195: * @param instant the milliseconds from 1970-01-01T00:00:00Z
196: */
197: public DateMidnight(long instant) {
198: super(instant);
199: }
200:
201: /**
202: * Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
203: * using ISOChronology in the specified time zone.
204: * The constructed object will have a local time of midnight.
205: *

206: * If the specified time zone is null, the default zone is used.
207: *
208: * @param instant the milliseconds from 1970-01-01T00:00:00Z
209: * @param zone the time zone, null means default zone
210: */
211: public DateMidnight(long instant, DateTimeZone zone) {
212: super(instant, zone);
213: }
214:
215: /**
216: * Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
217: * using the specified chronology.
218: * The constructed object will have a local time of midnight.
219: *

220: * If the chronology is null, ISOChronology
221: * in the default time zone is used.
222: *
223: * @param instant the milliseconds from 1970-01-01T00:00:00Z
224: * @param chronology the chronology, null means ISOChronology in default zone
225: */
226: public DateMidnight(long instant, Chronology chronology) {
227: super(instant, chronology);
228: }
229:
230: //-----------------------------------------------------------------------
231: /**
232: * Constructs an instance from an Object that represents a datetime.
233: * The constructed object will have a local time of midnight.
234: *

235: * If the object implies a chronology (such as GregorianCalendar does),
236: * then that chronology will be used. Otherwise, ISO default is used.
237: * Thus if a GregorianCalendar is passed in, the chronology used will
238: * be GJ, but if a Date is passed in the chronology will be ISO.
239: *

240: * The recognised object types are defined in
241: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
242: * include ReadableInstant, String, Calendar and Date.
243: * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()}.
244: *
245: * @param instant the datetime object, null means now
246: * @throws IllegalArgumentException if the instant is invalid
247: */
248: public DateMidnight(Object instant) {
249: super(instant, (Chronology) null);
250: }
251:
252: /**
253: * Constructs an instance from an Object that represents a datetime,
254: * forcing the time zone to that specified.
255: * The constructed object will have a local time of midnight.
256: *

257: * If the object implies a chronology (such as GregorianCalendar does),
258: * then that chronology will be used, but with the time zone adjusted.
259: * Otherwise, ISO is used in the specified time zone.
260: * If the specified time zone is null, the default zone is used.
261: * Thus if a GregorianCalendar is passed in, the chronology used will
262: * be GJ, but if a Date is passed in the chronology will be ISO.
263: *

264: * The recognised object types are defined in
265: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
266: * include ReadableInstant, String, Calendar and Date.
267: * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()}.
268: *
269: * @param instant the datetime object, null means now
270: * @param zone the time zone, null means default time zone
271: * @throws IllegalArgumentException if the instant is invalid
272: */
273: public DateMidnight(Object instant, DateTimeZone zone) {
274: super(instant, zone);
275: }
276:
277: /**
278: * Constructs an instance from an Object that represents a datetime,
279: * using the specified chronology.
280: * The constructed object will have a local time of midnight.
281: *

282: * If the chronology is null, ISO in the default time zone is used.
283: * Any chronology implied by the object (such as GregorianCalendar does)
284: * is ignored.
285: *

286: * The recognised object types are defined in
287: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
288: * include ReadableInstant, String, Calendar and Date.
289: * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()}.
290: *
291: * @param instant the datetime object, null means now
292: * @param chronology the chronology, null means ISOChronology in default zone
293: * @throws IllegalArgumentException if the instant is invalid
294: */
295: public DateMidnight(Object instant, Chronology chronology) {
296: super(instant, DateTimeUtils.getChronology(chronology));
297: }
298:
299: //-----------------------------------------------------------------------
300: /**
301: * Constructs an instance from datetime field values
302: * using ISOChronology in the default time zone.
303: * The constructed object will have a local time of midnight.
304: *
305: * @param year the year
306: * @param monthOfYear the month of the year
307: * @param dayOfMonth the day of the month
308: */
309: public DateMidnight(int year, int monthOfYear, int dayOfMonth) {
310: super(year, monthOfYear, dayOfMonth, 0, 0, 0, 0);
311: }
312:
313: /**
314: * Constructs an instance from datetime field values
315: * using ISOChronology in the specified time zone.
316: * The constructed object will have a local time of midnight.
317: *

318: * If the specified time zone is null, the default zone is used.
319: *
320: * @param year the year
321: * @param monthOfYear the month of the year
322: * @param dayOfMonth the day of the month
323: * @param zone the time zone, null means default time zone
324: */
325: public DateMidnight(int year, int monthOfYear, int dayOfMonth, DateTimeZone zone) {
326: super(year, monthOfYear, dayOfMonth, 0, 0, 0, 0, zone);
327: }
328:
329: /**
330: * Constructs an instance from datetime field values
331: * using the specified chronology.
332: * The constructed object will have a local time of midnight.
333: *

334: * If the chronology is null, ISOChronology
335: * in the default time zone is used.
336: *
337: * @param year the year
338: * @param monthOfYear the month of the year
339: * @param dayOfMonth the day of the month
340: * @param chronology the chronology, null means ISOChronology in default zone
341: */
342: public DateMidnight(int year, int monthOfYear, int dayOfMonth, Chronology chronology) {
343: super(year, monthOfYear, dayOfMonth, 0, 0, 0, 0, chronology);
344: }
345:
346: /**
347: * Rounds the specified instant to midnight.
348: *
349: * @param instant the milliseconds from 1970-01-01T00:00:00Z to round
350: * @param chronology the chronology to use, not null
351: * @return the updated instant, rounded to midnight
352: */
353: protected long checkInstant(long instant, Chronology chronology) {
354: return chronology.dayOfMonth().roundFloor(instant);
355: }
356:
357: //-----------------------------------------------------------------------
358: /**
359: * Returns a copy of this date with a different millisecond instant.
360: * The returned object will have a local time of midnight.
361: *

362: * Only the millis will change, the chronology and time zone are kept.
363: * The returned object will be either be a new instance or this.
364: *
365: * @param newMillis the new millis, from 1970-01-01T00:00:00Z
366: * @return a copy of this instant with different millis
367: */
368: public DateMidnight withMillis(long newMillis) {
369: Chronology chrono = getChronology();
370: newMillis = checkInstant(newMillis, chrono);
371: return (newMillis == getMillis() ? this : new DateMidnight(newMillis, chrono));
372: }
373:
374: /**
375: * Returns a copy of this date with a different chronology, potentially
376: * changing the day in unexpected ways.
377: *

378: * This method creates a new DateMidnight using the midnight millisecond value
379: * and the new chronology. If the same or similar chronology is specified, but
380: * with a different time zone, the day may change. This occurs because the new
381: * DateMidnight rounds down the millisecond value to get to midnight, and the
382: * time zone change may result in a rounding down to a different day.
383: *

384: * For example, changing time zone from London (+00:00) to Paris (+01:00) will
385: * retain the same day, but changing from Paris to London will change the day.
386: * (When its midnight in London its the same day in Paris, but when its midnight
387: * in Paris its still the previous day in London)
388: *

389: * To avoid these unusual effects, use {@link #withZoneRetainFields(DateTimeZone)}
390: * to change time zones.
391: *
392: * @param newChronology the new chronology
393: * @return a copy of this instant with a different chronology
394: */
395: public DateMidnight withChronology(Chronology newChronology) {
396: return (newChronology == getChronology() ? this : new DateMidnight(getMillis(), newChronology));
397: }
398:
399: /**
400: * Returns a copy of this date with a different time zone, preserving the day
401: * The returned object will have a local time of midnight in the new zone on
402: * the same day as the original instant.
403: *
404: * @param newZone the new time zone, null means default
405: * @return a copy of this instant with a different time zone
406: */
407: public DateMidnight withZoneRetainFields(DateTimeZone newZone) {
408: newZone = DateTimeUtils.getZone(newZone);
409: DateTimeZone originalZone = DateTimeUtils.getZone(getZone());
410: if (newZone == originalZone) {
411: return this;
412: }
413:
414: long millis = originalZone.getMillisKeepLocal(newZone, getMillis());
415: return new DateMidnight(millis, getChronology().withZone(newZone));
416: }
417:
418: //-----------------------------------------------------------------------
419: /**
420: * Returns a copy of this date with the partial set of fields replacing those
421: * from this instance.
422: *

423: * For example, if the partial is a LocalDate then the date fields
424: * would be changed in the returned instance.
425: * If the partial is null, then this is returned.
426: *
427: * @param partial the partial set of fields to apply to this datetime, null ignored
428: * @return a copy of this datetime with a different set of fields
429: * @throws IllegalArgumentException if any value is invalid
430: */
431: public DateMidnight withFields(ReadablePartial partial) {
432: if (partial == null) {
433: return this;
434: }
435: return withMillis(getChronology().set(partial, getMillis()));
436: }
437:
438: /**
439: * Returns a copy of this date with the specified field set to a new value.
440: *

441: * For example, if the field type is dayOfMonth then the day of month
442: * field would be changed in the returned instance.
443: * If the field type is null, then this is returned.
444: *

445: * These three lines are equivalent:
446: *

447: * DateTime updated = dt.withField(DateTimeFieldType.dayOfMonth(), 6);
448: * DateTime updated = dt.dayOfMonth().setCopy(6);
449: * DateTime updated = dt.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
450: *

451: *
452: * @param fieldType the field type to set, not null
453: * @param value the value to set
454: * @return a copy of this datetime with the field set
455: * @throws IllegalArgumentException if the value is null or invalid
456: */
457: public DateMidnight withField(DateTimeFieldType fieldType, int value) {
458: if (fieldType == null) {
459: throw new IllegalArgumentException("Field must not be null");
460: }
461: long instant = fieldType.getField(getChronology()).set(getMillis(), value);
462: return withMillis(instant);
463: }
464:
465: /**
466: * Returns a copy of this date with the value of the specified field increased.
467: *

468: * If the addition is zero or the field is null, then this is returned.
469: *

470: * These three lines are equivalent:
471: *

472: * DateMidnight added = dt.withFieldAdded(DateTimeFieldType.year(), 6);
473: * DateMidnight added = dt.plusYears(6);
474: * DateMidnight added = dt.year().addToCopy(6);
475: *

476: *
477: * @param fieldType the field type to add to, not null
478: * @param amount the amount to add
479: * @return a copy of this datetime with the field updated
480: * @throws IllegalArgumentException if the value is null or invalid
481: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
482: */
483: public DateMidnight withFieldAdded(DurationFieldType fieldType, int amount) {
484: if (fieldType == null) {
485: throw new IllegalArgumentException("Field must not be null");
486: }
487: if (amount == 0) {
488: return this;
489: }
490: long instant = fieldType.getField(getChronology()).add(getMillis(), amount);
491: return withMillis(instant);
492: }
493:
494: //-----------------------------------------------------------------------
495: /**
496: * Returns a copy of this date with the specified duration added.
497: *

498: * If the addition is zero, then this is returned.
499: *
500: * @param durationToAdd the duration to add to this one
501: * @param scalar the amount of times to add, such as -1 to subtract once
502: * @return a copy of this datetime with the duration added
503: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
504: */
505: public DateMidnight withDurationAdded(long durationToAdd, int scalar) {
506: if (durationToAdd == 0 || scalar == 0) {
507: return this;
508: }
509: long instant = getChronology().add(getMillis(), durationToAdd, scalar);
510: return withMillis(instant);
511: }
512:
513: /**
514: * Returns a copy of this date with the specified duration added.
515: *

516: * If the addition is zero, then this is returned.
517: *
518: * @param durationToAdd the duration to add to this one, null means zero
519: * @param scalar the amount of times to add, such as -1 to subtract once
520: * @return a copy of this datetime with the duration added
521: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
522: */
523: public DateMidnight withDurationAdded(ReadableDuration durationToAdd, int scalar) {
524: if (durationToAdd == null || scalar == 0) {
525: return this;
526: }
527: return withDurationAdded(durationToAdd.getMillis(), scalar);
528: }
529:
530: /**
531: * Returns a copy of this date with the specified period added.
532: *

533: * If the addition is zero, then this is returned.
534: *

535: * This method is typically used to add multiple copies of complex
536: * period instances. Adding one field is best achieved using methods
537: * like {@link #withFieldAdded(DurationFieldType, int)}
538: * or {@link #plusYears(int)}.
539: *
540: * @param period the period to add to this one, null means zero
541: * @param scalar the amount of times to add, such as -1 to subtract once
542: * @return a copy of this datetime with the period added
543: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
544: */
545: public DateMidnight withPeriodAdded(ReadablePeriod period, int scalar) {
546: if (period == null || scalar == 0) {
547: return this;
548: }
549: long instant = getChronology().add(period, getMillis(), scalar);
550: return withMillis(instant);
551: }
552:
553: //-----------------------------------------------------------------------
554: /**
555: * Returns a copy of this date with the specified duration added.
556: *

557: * If the amount is zero, then this is returned.
558: *
559: * @param duration the duration, in millis, to add to this one
560: * @return a copy of this datetime with the duration added
561: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
562: */
563: public DateMidnight plus(long duration) {
564: return withDurationAdded(duration, 1);
565: }
566:
567: /**
568: * Returns a copy of this date with the specified duration added.
569: *

570: * If the amount is zero or null, then this is returned.
571: *
572: * @param duration the duration to add to this one, null means zero
573: * @return a copy of this datetime with the duration added
574: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
575: */
576: public DateMidnight plus(ReadableDuration duration) {
577: return withDurationAdded(duration, 1);
578: }
579:
580: /**
581: * Returns a copy of this date with the specified period added.
582: *

583: * If the amount is zero or null, then this is returned.
584: *

585: * This method is typically used to add complex period instances.
586: * Adding one field is best achieved using methods
587: * like {@link #plusYears(int)}.
588: *
589: * @param period the duration to add to this one, null means zero
590: * @return a copy of this datetime with the period added
591: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
592: */
593: public DateMidnight plus(ReadablePeriod period) {
594: return withPeriodAdded(period, 1);
595: }
596:
597: //-----------------------------------------------------------------------
598: /**
599: * Returns a copy of this date plus the specified number of years.
600: *

601: * This datetime instance is immutable and unaffected by this method call.
602: *

603: * The following three lines are identical in effect:
604: *

605: * DateMidnight added = dt.plusYears(6);
606: * DateMidnight added = dt.plus(Period.years(6));
607: * DateMidnight added = dt.withFieldAdded(DurationFieldType.years(), 6);
608: *

609: *
610: * @param years the amount of years to add, may be negative
611: * @return the new datetime plus the increased years
612: * @since 1.1
613: */
614: public DateMidnight plusYears(int years) {
615: if (years == 0) {
616: return this;
617: }
618: long instant = getChronology().years().add(getMillis(), years);
619: return withMillis(instant);
620: }
621:
622: /**
623: * Returns a copy of this date plus the specified number of months.
624: *

625: * This datetime instance is immutable and unaffected by this method call.
626: *

627: * The following three lines are identical in effect:
628: *

629: * DateMidnight added = dt.plusMonths(6);
630: * DateMidnight added = dt.plus(Period.months(6));
631: * DateMidnight added = dt.withFieldAdded(DurationFieldType.months(), 6);
632: *

633: *
634: * @param months the amount of months to add, may be negative
635: * @return the new datetime plus the increased months
636: * @since 1.1
637: */
638: public DateMidnight plusMonths(int months) {
639: if (months == 0) {
640: return this;
641: }
642: long instant = getChronology().months().add(getMillis(), months);
643: return withMillis(instant);
644: }
645:
646: /**
647: * Returns a copy of this date plus the specified number of weeks.
648: *

649: * This datetime instance is immutable and unaffected by this method call.
650: *

651: * The following three lines are identical in effect:
652: *

653: * DateMidnight added = dt.plusWeeks(6);
654: * DateMidnight added = dt.plus(Period.weeks(6));
655: * DateMidnight added = dt.withFieldAdded(DurationFieldType.weeks(), 6);
656: *

657: *
658: * @param weeks the amount of weeks to add, may be negative
659: * @return the new datetime plus the increased weeks
660: * @since 1.1
661: */
662: public DateMidnight plusWeeks(int weeks) {
663: if (weeks == 0) {
664: return this;
665: }
666: long instant = getChronology().weeks().add(getMillis(), weeks);
667: return withMillis(instant);
668: }
669:
670: /**
671: * Returns a copy of this date plus the specified number of days.
672: *

673: * This datetime instance is immutable and unaffected by this method call.
674: *

675: * The following three lines are identical in effect:
676: *

677: * DateMidnight added = dt.plusDays(6);
678: * DateMidnight added = dt.plus(Period.days(6));
679: * DateMidnight added = dt.withFieldAdded(DurationFieldType.days(), 6);
680: *

681: *
682: * @param days the amount of days to add, may be negative
683: * @return the new datetime plus the increased days
684: * @since 1.1
685: */
686: public DateMidnight plusDays(int days) {
687: if (days == 0) {
688: return this;
689: }
690: long instant = getChronology().days().add(getMillis(), days);
691: return withMillis(instant);
692: }
693:
694: //-----------------------------------------------------------------------
695: /**
696: * Returns a copy of this date with the specified duration taken away.
697: *

698: * If the amount is zero or null, then this is returned.
699: *
700: * @param duration the duration, in millis, to reduce this instant by
701: * @return a copy of this datetime with the duration taken away
702: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
703: */
704: public DateMidnight minus(long duration) {
705: return withDurationAdded(duration, -1);
706: }
707:
708: /**
709: * Returns a copy of this date with the specified duration taken away.
710: *

711: * If the amount is zero or null, then this is returned.
712: *
713: * @param duration the duration to reduce this instant by
714: * @return a copy of this datetime with the duration taken away
715: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
716: */
717: public DateMidnight minus(ReadableDuration duration) {
718: return withDurationAdded(duration, -1);
719: }
720:
721: /**
722: * Returns a copy of this date with the specified period taken away.
723: *

724: * If the amount is zero or null, then this is returned.
725: *

726: * This method is typically used to subtract complex period instances.
727: * Subtracting one field is best achieved using methods
728: * like {@link #minusYears(int)}.
729: *
730: * @param period the period to reduce this instant by
731: * @return a copy of this datetime with the period taken away
732: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
733: */
734: public DateMidnight minus(ReadablePeriod period) {
735: return withPeriodAdded(period, -1);
736: }
737:
738: //-----------------------------------------------------------------------
739: /**
740: * Returns a copy of this date minus the specified number of years.
741: *

742: * This datetime instance is immutable and unaffected by this method call.
743: *

744: * The following three lines are identical in effect:
745: *

746: * DateTime subtracted = dt.minusYears(6);
747: * DateTime subtracted = dt.minus(Period.years(6));
748: * DateTime subtracted = dt.withFieldAdded(DurationFieldType.years(), -6);
749: *

750: *
751: * @param years the amount of years to subtract, may be negative
752: * @return the new datetime minus the increased years
753: * @since 1.1
754: */
755: public DateMidnight minusYears(int years) {
756: if (years == 0) {
757: return this;
758: }
759: long instant = getChronology().years().subtract(getMillis(), years);
760: return withMillis(instant);
761: }
762:
763: /**
764: * Returns a copy of this date minus the specified number of months.
765: *

766: * This datetime instance is immutable and unaffected by this method call.
767: *

768: * The following three lines are identical in effect:
769: *

770: * DateMidnight subtracted = dt.minusMonths(6);
771: * DateMidnight subtracted = dt.minus(Period.months(6));
772: * DateMidnight subtracted = dt.withFieldAdded(DurationFieldType.months(), -6);
773: *

774: *
775: * @param months the amount of months to subtract, may be negative
776: * @return the new datetime minus the increased months
777: * @since 1.1
778: */
779: public DateMidnight minusMonths(int months) {
780: if (months == 0) {
781: return this;
782: }
783: long instant = getChronology().months().subtract(getMillis(), months);
784: return withMillis(instant);
785: }
786:
787: /**
788: * Returns a copy of this date minus the specified number of weeks.
789: *

790: * This datetime instance is immutable and unaffected by this method call.
791: *

792: * The following three lines are identical in effect:
793: *

794: * DateMidnight subtracted = dt.minusWeeks(6);
795: * DateMidnight subtracted = dt.minus(Period.weeks(6));
796: * DateMidnight subtracted = dt.withFieldAdded(DurationFieldType.weeks(), -6);
797: *

798: *
799: * @param weeks the amount of weeks to subtract, may be negative
800: * @return the new datetime minus the increased weeks
801: * @since 1.1
802: */
803: public DateMidnight minusWeeks(int weeks) {
804: if (weeks == 0) {
805: return this;
806: }
807: long instant = getChronology().weeks().subtract(getMillis(), weeks);
808: return withMillis(instant);
809: }
810:
811: /**
812: * Returns a copy of this date minus the specified number of days.
813: *

814: * This datetime instance is immutable and unaffected by this method call.
815: *

816: * The following three lines are identical in effect:
817: *

818: * DateMidnight subtracted = dt.minusDays(6);
819: * DateMidnight subtracted = dt.minus(Period.days(6));
820: * DateMidnight subtracted = dt.withFieldAdded(DurationFieldType.days(), -6);
821: *

822: *
823: * @param days the amount of days to subtract, may be negative
824: * @return the new datetime minus the increased days
825: * @since 1.1
826: */
827: public DateMidnight minusDays(int days) {
828: if (days == 0) {
829: return this;
830: }
831: long instant = getChronology().days().subtract(getMillis(), days);
832: return withMillis(instant);
833: }
834:
835: //-----------------------------------------------------------------------
836: /**
837: * Gets the property object for the specified type, which contains many useful methods.
838: *
839: * @param type the field type to get the chronology for
840: * @return the property object
841: * @throws IllegalArgumentException if the field is null or unsupported
842: */
843: public Property property(DateTimeFieldType type) {
844: if (type == null) {
845: throw new IllegalArgumentException("The DateTimeFieldType must not be null");
846: }
847: DateTimeField field = type.getField(getChronology());
848: if (field.isSupported() == false) {
849: throw new IllegalArgumentException("Field '" + type + "' is not supported");
850: }
851: return new Property(this, field);
852: }
853:
854: //-----------------------------------------------------------------------
855: /**
856: * Converts this object to a YearMonthDay using the
857: * same date and chronology.
858: *
859: * @return a YearMonthDay using the same millis and chronology
860: * @deprecated Use LocalDate instead of YearMonthDay
861: */
862: @Deprecated
863: public YearMonthDay toYearMonthDay() {
864: return new YearMonthDay(getMillis(), getChronology());
865: }
866:
867: /**
868: * Converts this object to a LocalDate with the
869: * same date and chronology.
870: *
871: * @return a LocalDate with the same date and chronology
872: * @since 1.3
873: */
874: public LocalDate toLocalDate() {
875: return new LocalDate(getMillis(), getChronology());
876: }
877:
878: /**
879: * Converts this object to an Interval encompassing
880: * the whole of this day.
881: *

882: * The interval starts at midnight 00:00 and ends at 00:00 the following day,
883: * (which is not included in the interval, as intervals are half-open).
884: *
885: * @return an interval over the day
886: */
887: public Interval toInterval() {
888: Chronology chrono = getChronology();
889: long start = getMillis();
890: long end = DurationFieldType.days().getField(chrono).add(start, 1);
891: return new Interval(start, end, chrono);
892: }
893:
894: //-----------------------------------------------------------------------
895: /**
896: * Returns a copy of this date with the era field updated.
897: *

898: * DateMidnight is immutable, so there are no set methods.
899: * Instead, this method returns a new instance with the value of
900: * era changed.
901: *
902: * @param era the era to set
903: * @return a copy of this object with the field set
904: * @throws IllegalArgumentException if the value is invalid
905: * @since 1.3
906: */
907: public DateMidnight withEra(int era) {
908: return withMillis(getChronology().era().set(getMillis(), era));
909: }
910:
911: /**
912: * Returns a copy of this date with the century of era field updated.
913: *

914: * DateMidnight is immutable, so there are no set methods.
915: * Instead, this method returns a new instance with the value of
916: * century of era changed.
917: *
918: * @param centuryOfEra the centurey of era to set
919: * @return a copy of this object with the field set
920: * @throws IllegalArgumentException if the value is invalid
921: * @since 1.3
922: */
923: public DateMidnight withCenturyOfEra(int centuryOfEra) {
924: return withMillis(getChronology().centuryOfEra().set(getMillis(), centuryOfEra));
925: }
926:
927: /**
928: * Returns a copy of this date with the year of era field updated.
929: *

930: * DateMidnight is immutable, so there are no set methods.
931: * Instead, this method returns a new instance with the value of
932: * year of era changed.
933: *
934: * @param yearOfEra the year of era to set
935: * @return a copy of this object with the field set
936: * @throws IllegalArgumentException if the value is invalid
937: * @since 1.3
938: */
939: public DateMidnight withYearOfEra(int yearOfEra) {
940: return withMillis(getChronology().yearOfEra().set(getMillis(), yearOfEra));
941: }
942:
943: /**
944: * Returns a copy of this date with the year of century field updated.
945: *

946: * DateMidnight is immutable, so there are no set methods.
947: * Instead, this method returns a new instance with the value of
948: * year of century changed.
949: *
950: * @param yearOfCentury the year of century to set
951: * @return a copy of this object with the field set
952: * @throws IllegalArgumentException if the value is invalid
953: * @since 1.3
954: */
955: public DateMidnight withYearOfCentury(int yearOfCentury) {
956: return withMillis(getChronology().yearOfCentury().set(getMillis(), yearOfCentury));
957: }
958:
959: /**
960: * Returns a copy of this date with the year field updated.
961: *

962: * DateMidnight is immutable, so there are no set methods.
963: * Instead, this method returns a new instance with the value of
964: * year changed.
965: *
966: * @param year the year to set
967: * @return a copy of this object with the field set
968: * @throws IllegalArgumentException if the value is invalid
969: * @since 1.3
970: */
971: public DateMidnight withYear(int year) {
972: return withMillis(getChronology().year().set(getMillis(), year));
973: }
974:
975: /**
976: * Returns a copy of this date with the weekyear field updated.
977: *

978: * The weekyear is the year that matches with the weekOfWeekyear field.
979: * In the standard ISO8601 week algorithm, the first week of the year
980: * is that in which at least 4 days are in the year. As a result of this
981: * definition, day 1 of the first week may be in the previous year.
982: * The weekyear allows you to query the effective year for that day.
983: *

984: * DateMidnight is immutable, so there are no set methods.
985: * Instead, this method returns a new instance with the value of
986: * weekyear changed.
987: *
988: * @param weekyear the weekyear to set
989: * @return a copy of this object with the field set
990: * @throws IllegalArgumentException if the value is invalid
991: * @since 1.3
992: */
993: public DateMidnight withWeekyear(int weekyear) {
994: return withMillis(getChronology().weekyear().set(getMillis(), weekyear));
995: }
996:
997: /**
998: * Returns a copy of this date with the month of year field updated.
999: *

1000: * DateMidnight is immutable, so there are no set methods.
1001: * Instead, this method returns a new instance with the value of
1002: * month of year changed.
1003: *
1004: * @param monthOfYear the month of year to set
1005: * @return a copy of this object with the field set
1006: * @throws IllegalArgumentException if the value is invalid
1007: * @since 1.3
1008: */
1009: public DateMidnight withMonthOfYear(int monthOfYear) {
1010: return withMillis(getChronology().monthOfYear().set(getMillis(), monthOfYear));
1011: }
1012:
1013: /**
1014: * Returns a copy of this date with the week of weekyear field updated.
1015: *

1016: * This field is associated with the "weekyear" via {@link #withWeekyear(int)}.
1017: * In the standard ISO8601 week algorithm, the first week of the year
1018: * is that in which at least 4 days are in the year. As a result of this
1019: * definition, day 1 of the first week may be in the previous year.
1020: *

1021: * DateMidnight is immutable, so there are no set methods.
1022: * Instead, this method returns a new instance with the value of
1023: * week of weekyear changed.
1024: *
1025: * @param weekOfWeekyear the week of weekyear to set
1026: * @return a copy of this object with the field set
1027: * @throws IllegalArgumentException if the value is invalid
1028: * @since 1.3
1029: */
1030: public DateMidnight withWeekOfWeekyear(int weekOfWeekyear) {
1031: return withMillis(getChronology().weekOfWeekyear().set(getMillis(), weekOfWeekyear));
1032: }
1033:
1034: /**
1035: * Returns a copy of this date with the day of year field updated.
1036: *

1037: * DateMidnight is immutable, so there are no set methods.
1038: * Instead, this method returns a new instance with the value of
1039: * day of year changed.
1040: *
1041: * @param dayOfYear the day of year to set
1042: * @return a copy of this object with the field set
1043: * @throws IllegalArgumentException if the value is invalid
1044: * @since 1.3
1045: */
1046: public DateMidnight withDayOfYear(int dayOfYear) {
1047: return withMillis(getChronology().dayOfYear().set(getMillis(), dayOfYear));
1048: }
1049:
1050: /**
1051: * Returns a copy of this date with the day of month field updated.
1052: *

1053: * DateMidnight is immutable, so there are no set methods.
1054: * Instead, this method returns a new instance with the value of
1055: * day of month changed.
1056: *
1057: * @param dayOfMonth the day of month to set
1058: * @return a copy of this object with the field set
1059: * @throws IllegalArgumentException if the value is invalid
1060: * @since 1.3
1061: */
1062: public DateMidnight withDayOfMonth(int dayOfMonth) {
1063: return withMillis(getChronology().dayOfMonth().set(getMillis(), dayOfMonth));
1064: }
1065:
1066: /**
1067: * Returns a copy of this date with the day of week field updated.
1068: *

1069: * DateMidnight is immutable, so there are no set methods.
1070: * Instead, this method returns a new instance with the value of
1071: * day of week changed.
1072: *
1073: * @param dayOfWeek the day of week to set
1074: * @return a copy of this object with the field set
1075: * @throws IllegalArgumentException if the value is invalid
1076: * @since 1.3
1077: */
1078: public DateMidnight withDayOfWeek(int dayOfWeek) {
1079: return withMillis(getChronology().dayOfWeek().set(getMillis(), dayOfWeek));
1080: }
1081:
1082: // Date properties
1083: //-----------------------------------------------------------------------
1084: /**
1085: * Get the era property which provides access to advanced functionality.
1086: *
1087: * @return the era property
1088: */
1089: public Property era() {
1090: return new Property(this, getChronology().era());
1091: }
1092:
1093: /**
1094: * Get the century of era property which provides access to advanced functionality.
1095: *
1096: * @return the year of era property
1097: */
1098: public Property centuryOfEra() {
1099: return new Property(this, getChronology().centuryOfEra());
1100: }
1101:
1102: /**
1103: * Get the year of century property which provides access to advanced functionality.
1104: *
1105: * @return the year of era property
1106: */
1107: public Property yearOfCentury() {
1108: return new Property(this, getChronology().yearOfCentury());
1109: }
1110:
1111: /**
1112: * Get the year of era property which provides access to advanced functionality.
1113: *
1114: * @return the year of era property
1115: */
1116: public Property yearOfEra() {
1117: return new Property(this, getChronology().yearOfEra());
1118: }
1119:
1120: /**
1121: * Get the year property which provides access to advanced functionality.
1122: *
1123: * @return the year property
1124: */
1125: public Property year() {
1126: return new Property(this, getChronology().year());
1127: }
1128:
1129: /**
1130: * Get the year of a week based year property which provides access to advanced functionality.
1131: *
1132: * @return the year of a week based year property
1133: */
1134: public Property weekyear() {
1135: return new Property(this, getChronology().weekyear());
1136: }
1137:
1138: /**
1139: * Get the month of year property which provides access to advanced functionality.
1140: *
1141: * @return the month of year property
1142: */
1143: public Property monthOfYear() {
1144: return new Property(this, getChronology().monthOfYear());
1145: }
1146:
1147: /**
1148: * Get the week of a week based year property which provides access to advanced functionality.
1149: *
1150: * @return the week of a week based year property
1151: */
1152: public Property weekOfWeekyear() {
1153: return new Property(this, getChronology().weekOfWeekyear());
1154: }
1155:
1156: /**
1157: * Get the day of year property which provides access to advanced functionality.
1158: *
1159: * @return the day of year property
1160: */
1161: public Property dayOfYear() {
1162: return new Property(this, getChronology().dayOfYear());
1163: }
1164:
1165: /**
1166: * Get the day of month property which provides access to advanced functionality.
1167: *
1168: * @return the day of month property
1169: */
1170: public Property dayOfMonth() {
1171: return new Property(this, getChronology().dayOfMonth());
1172: }
1173:
1174: /**
1175: * Get the day of week property which provides access to advanced functionality.
1176: *
1177: * @return the day of week property
1178: */
1179: public Property dayOfWeek() {
1180: return new Property(this, getChronology().dayOfWeek());
1181: }
1182:
1183: //-----------------------------------------------------------------------
1184: /**
1185: * DateMidnight.Property binds a DateMidnight to a DateTimeField allowing powerful
1186: * datetime functionality to be easily accessed.
1187: *

1188: * The simplest use of this class is as an alternative get method, here used to
1189: * get the year '1972' (as an int) and the month 'December' (as a String).
1190: *

1191: * DateMidnight dt = new DateMidnight(1972, 12, 3);
1192: * int year = dt.year().get();
1193: * String monthStr = dt.monthOfYear().getAsText();
1194: *

1195: *

1196: * Methods are also provided that allow date modification. These return new instances
1197: * of DateMidnight - they do not modify the original. The example below yields two
1198: * independent immutable date objects 20 years apart.
1199: *

1200: * DateMidnight dt = new DateMidnight(1972, 12, 3);
1201: * DateMidnight dt20 = dt.year().addToCopy(20);
1202: *

1203: * Serious modification of dates (ie. more than just changing one or two fields)
1204: * should use the {@link org.joda.time.MutableDateTime MutableDateTime} class.
1205: *

1206: * DateMidnight.Property itself is thread-safe and immutable.
1207: *
1208: * @author Stephen Colebourne
1209: * @author Brian S O'Neill
1210: * @since 1.0
1211: */
1212: public static final class Property extends AbstractReadableInstantFieldProperty {
1213:
1214: /** Serialization lock */
1215: private static final long serialVersionUID = 257629620L;
1216:
1217: /** The instant this property is working against */
1218: private DateMidnight iInstant;
1219: /** The field this property is working against */
1220: private DateTimeField iField;
1221:
1222: /**
1223: * Constructor.
1224: *
1225: * @param instant the instant to set
1226: * @param field the field to use
1227: */
1228: Property(DateMidnight instant, DateTimeField field) {
1229: super();
1230: iInstant = instant;
1231: iField = field;
1232: }
1233:
1234: /**
1235: * Writes the property in a safe serialization format.
1236: */
1237: private void writeObject(ObjectOutputStream oos) throws IOException {
1238: oos.writeObject(iInstant);
1239: oos.writeObject(iField.getType());
1240: }
1241:
1242: /**
1243: * Reads the property from a safe serialization format.
1244: */
1245: private void readObject(ObjectInputStream oos) throws IOException, ClassNotFoundException {
1246: iInstant = (DateMidnight) oos.readObject();
1247: DateTimeFieldType type = (DateTimeFieldType) oos.readObject();
1248: iField = type.getField(iInstant.getChronology());
1249: }
1250:
1251: //-----------------------------------------------------------------------
1252: /**
1253: * Gets the field being used.
1254: *
1255: * @return the field
1256: */
1257: public DateTimeField getField() {
1258: return iField;
1259: }
1260:
1261: /**
1262: * Gets the milliseconds of the datetime that this property is linked to.
1263: *
1264: * @return the milliseconds
1265: */
1266: protected long getMillis() {
1267: return iInstant.getMillis();
1268: }
1269:
1270: /**
1271: * Gets the chronology of the datetime that this property is linked to.
1272: *
1273: * @return the chronology
1274: * @since 1.4
1275: */
1276: protected Chronology getChronology() {
1277: return iInstant.getChronology();
1278: }
1279:
1280: /**
1281: * Gets the datetime being used.
1282: *
1283: * @return the datetime
1284: */
1285: public DateMidnight getDateMidnight() {
1286: return iInstant;
1287: }
1288:
1289: //-----------------------------------------------------------------------
1290: /**
1291: * Adds to this field in a copy of this DateMidnight.
1292: *

1293: * The DateMidnight attached to this property is unchanged by this call.
1294: * This operation is faster than converting a DateMidnight to a MutableDateTime
1295: * and back again when setting one field. When setting multiple fields,
1296: * it is generally quicker to make the conversion to MutableDateTime.
1297: *
1298: * @param value the value to add to the field in the copy
1299: * @return a copy of the DateMidnight with the field value changed
1300: * @throws IllegalArgumentException if the value isn't valid
1301: */
1302: public DateMidnight addToCopy(int value) {
1303: return iInstant.withMillis(iField.add(iInstant.getMillis(), value));
1304: }
1305:
1306: /**
1307: * Adds to this field in a copy of this DateMidnight.
1308: *

1309: * The DateMidnight attached to this property is unchanged by this call.
1310: * This operation is faster than converting a DateMidnight to a MutableDateTime
1311: * and back again when setting one field. When setting multiple fields,
1312: * it is generally quicker to make the conversion to MutableDateTime.
1313: *
1314: * @param value the value to add to the field in the copy
1315: * @return a copy of the DateMidnight with the field value changed
1316: * @throws IllegalArgumentException if the value isn't valid
1317: */
1318: public DateMidnight addToCopy(long value) {
1319: return iInstant.withMillis(iField.add(iInstant.getMillis(), value));
1320: }
1321:
1322: /**
1323: * Adds to this field, possibly wrapped, in a copy of this DateMidnight.
1324: * A wrapped operation only changes this field.
1325: * Thus 31st January addWrapField one day goes to the 1st January.
1326: *

1327: * The DateMidnight attached to this property is unchanged by this call.
1328: * This operation is faster than converting a DateMidnight to a MutableDateTime
1329: * and back again when setting one field. When setting multiple fields,
1330: * it is generally quicker to make the conversion to MutableDateTime.
1331: *
1332: * @param value the value to add to the field in the copy
1333: * @return a copy of the DateMidnight with the field value changed
1334: * @throws IllegalArgumentException if the value isn't valid
1335: */
1336: public DateMidnight addWrapFieldToCopy(int value) {
1337: return iInstant.withMillis(iField.addWrapField(iInstant.getMillis(), value));
1338: }
1339:
1340: //-----------------------------------------------------------------------
1341: /**
1342: * Sets this field in a copy of the DateMidnight.
1343: *

1344: * The DateMidnight attached to this property is unchanged by this call.
1345: * This operation is faster than converting a DateMidnight to a MutableDateTime
1346: * and back again when setting one field. When setting multiple fields,
1347: * it is generally quicker to make the conversion to MutableDateTime.
1348: *
1349: * @param value the value to set the field in the copy to
1350: * @return a copy of the DateMidnight with the field value changed
1351: * @throws IllegalArgumentException if the value isn't valid
1352: */
1353: public DateMidnight setCopy(int value) {
1354: return iInstant.withMillis(iField.set(iInstant.getMillis(), value));
1355: }
1356:
1357: /**
1358: * Sets this field in a copy of the DateMidnight to a parsed text value.
1359: *

1360: * The DateMidnight attached to this property is unchanged by this call.
1361: * This operation is faster than converting a DateMidnight to a MutableDateTime
1362: * and back again when setting one field. When setting multiple fields,
1363: * it is generally quicker to make the conversion to MutableDateTime.
1364: *
1365: * @param text the text value to set
1366: * @param locale optional locale to use for selecting a text symbol
1367: * @return a copy of the DateMidnight with the field value changed
1368: * @throws IllegalArgumentException if the text value isn't valid
1369: */
1370: public DateMidnight setCopy(String text, Locale locale) {
1371: return iInstant.withMillis(iField.set(iInstant.getMillis(), text, locale));
1372: }
1373:
1374: /**
1375: * Sets this field in a copy of the DateMidnight to a parsed text value.
1376: *

1377: * The DateMidnight attached to this property is unchanged by this call.
1378: * This operation is faster than converting a DateMidnight to a MutableDateTime
1379: * and back again when setting one field. When setting multiple fields,
1380: * it is generally quicker to make the conversion to MutableDateTime.
1381: *
1382: * @param text the text value to set
1383: * @return a copy of the DateMidnight with the field value changed
1384: * @throws IllegalArgumentException if the text value isn't valid
1385: */
1386: public DateMidnight setCopy(String text) {
1387: return setCopy(text, null);
1388: }
1389:
1390: //-----------------------------------------------------------------------
1391: /**
1392: * Returns a new DateMidnight with this field set to the maximum value
1393: * for this field.
1394: *

1395: * This operation is useful for obtaining a DateTime on the last day
1396: * of the month, as month lengths vary.
1397: *

1398: * DateMidnight lastDayOfMonth = dt.dayOfMonth().withMaximumValue();
1399: *

1400: *

1401: * The DateMidnight attached to this property is unchanged by this call.
1402: *
1403: * @return a copy of the DateMidnight with this field set to its maximum
1404: * @since 1.2
1405: */
1406: public DateMidnight withMaximumValue() {
1407: return setCopy(getMaximumValue());
1408: }
1409:
1410: /**
1411: * Returns a new DateMidnight with this field set to the minimum value
1412: * for this field.
1413: *

1414: * The DateMidnight attached to this property is unchanged by this call.
1415: *
1416: * @return a copy of the DateMidnight with this field set to its minimum
1417: * @since 1.2
1418: */
1419: public DateMidnight withMinimumValue() {
1420: return setCopy(getMinimumValue());
1421: }
1422:
1423: //-----------------------------------------------------------------------
1424: /**
1425: * Rounds to the lowest whole unit of this field on a copy of this DateMidnight.
1426: *
1427: * @return a copy of the DateMidnight with the field value changed
1428: */
1429: public DateMidnight roundFloorCopy() {
1430: return iInstant.withMillis(iField.roundFloor(iInstant.getMillis()));
1431: }
1432:
1433: /**
1434: * Rounds to the highest whole unit of this field on a copy of this DateMidnight.
1435: *
1436: * @return a copy of the DateMidnight with the field value changed
1437: */
1438: public DateMidnight roundCeilingCopy() {
1439: return iInstant.withMillis(iField.roundCeiling(iInstant.getMillis()));
1440: }
1441:
1442: /**
1443: * Rounds to the nearest whole unit of this field on a copy of this DateMidnight,
1444: * favoring the floor if halfway.
1445: *
1446: * @return a copy of the DateMidnight with the field value changed
1447: */
1448: public DateMidnight roundHalfFloorCopy() {
1449: return iInstant.withMillis(iField.roundHalfFloor(iInstant.getMillis()));
1450: }
1451:
1452: /**
1453: * Rounds to the nearest whole unit of this field on a copy of this DateMidnight,
1454: * favoring the ceiling if halfway.
1455: *
1456: * @return a copy of the DateMidnight with the field value changed
1457: */
1458: public DateMidnight roundHalfCeilingCopy() {
1459: return iInstant.withMillis(iField.roundHalfCeiling(iInstant.getMillis()));
1460: }
1461:
1462: /**
1463: * Rounds to the nearest whole unit of this field on a copy of this DateMidnight.
1464: * If halfway, the ceiling is favored over the floor only if it makes this field's value even.
1465: *
1466: * @return a copy of the DateMidnight with the field value changed
1467: */
1468: public DateMidnight roundHalfEvenCopy() {
1469: return iInstant.withMillis(iField.roundHalfEven(iInstant.getMillis()));
1470: }
1471:
1472: }
1473: }
| ID | Line | Type | Detected |
|---|
| 7478 | 101 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7479 | 117 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7480 | 134 | Remove method call | |
| 7481 | 134(1) | Remove method call | |
| 7482 | 134(2) | Remove method call | |
| 7483 | 145 | Remove method call | |
| 7484 | 145(1) | Remove method call | |
| 7486 | 310 | Replace a constant (Replace 0 with -1(INT)) | |
| 7485 | 310 | Replace a constant (Replace 0 with 1(INT)) | |
| 7488 | 310(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 7487 | 310(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 7489 | 310(2) | Replace a constant (Replace 0 with 1(INT)) | |
| 7490 | 310(2) | Replace a constant (Replace 0 with -1(INT)) | |
| 7492 | 310(3) | Replace a constant (Replace 0 with -1(INT)) | |
| 7491 | 310(3) | Replace a constant (Replace 0 with 1(INT)) | |
| 7494 | 326 | Replace a constant (Replace 0 with -1(INT)) | |
| 7493 | 326 | Replace a constant (Replace 0 with 1(INT)) | |
| 7495 | 326(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 7496 | 326(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 7497 | 326(2) | Replace a constant (Replace 0 with 1(INT)) | |
| 7498 | 326(2) | Replace a constant (Replace 0 with -1(INT)) | |
| 7500 | 326(3) | Replace a constant (Replace 0 with -1(INT)) | |
| 7499 | 326(3) | Replace a constant (Replace 0 with 1(INT)) | |
| 7501 | 343 | Replace a constant (Replace 0 with 1(INT)) | |
| 7502 | 343 | Replace a constant (Replace 0 with -1(INT)) | |
| 7504 | 343(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 7503 | 343(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 7505 | 343(2) | Replace a constant (Replace 0 with 1(INT)) | |
| 7506 | 343(2) | Replace a constant (Replace 0 with -1(INT)) | |
| 7507 | 343(3) | Replace a constant (Replace 0 with 1(INT)) | |
| 7508 | 343(3) | Replace a constant (Replace 0 with -1(INT)) | |
| 7509 | 354 | Remove method call | |
| 7510 | 354(1) | Remove method call | |
| 7511 | 369 | Remove method call | |
| 7512 | 370 | Remove method call | |
| 7514 | 371 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7513 | 371 | Remove method call | |
| 7516 | 396 | Negate jump condition (Replace IF_ACMPNE with IF_ACMPEQ) | |
| 7515 | 396 | Remove method call | |
| 7517 | 396(1) | Remove method call | |
| 7518 | 408 | Remove method call | |
| 7519 | 409 | Remove method call | |
| 7520 | 409(1) | Remove method call | |
| 7521 | 410 | Negate jump condition (Replace IF_ACMPNE with IF_ACMPEQ) | |
| 7522 | 414 | Remove method call | |
| 7523 | 414(1) | Remove method call | |
| 7524 | 415 | Remove method call | |
| 7525 | 415(1) | Remove method call | |
| 7526 | 432 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7527 | 435 | Remove method call | |
| 7528 | 435(1) | Remove method call | |
| 7529 | 435(2) | Remove method call | |
| 7530 | 435(3) | Remove method call | |
| 7531 | 458 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7532 | 461 | Remove method call | |
| 7533 | 461(1) | Remove method call | |
| 7534 | 461(2) | Remove method call | |
| 7535 | 461(3) | Remove method call | |
| 7536 | 462 | Remove method call | |
| 7537 | 484 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7538 | 487 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7539 | 490 | Remove method call | |
| 7540 | 490(1) | Remove method call | |
| 7541 | 490(2) | Remove method call | |
| 7542 | 490(3) | Remove method call | |
| 7543 | 491 | Remove method call | |
| 7544 | 506 | Replace a constant (Replace 0 with 1(LONG)) | |
| 7545 | 506 | Replace a constant (Replace 0 with -1(LONG)) | |
| 7546 | 506 | Negate jump condition (Replace IFEQ with IFNE) | |
| 7547 | 506(1) | Negate jump condition (Replace IFNE with IFEQ) | |
| 7548 | 509 | Remove method call | |
| 7549 | 509(1) | Remove method call | |
| 7550 | 509(2) | Remove method call | |
| 7551 | 510 | Remove method call | |
| 7552 | 524 | Negate jump condition (Replace IFNULL with IFNONNULL) | |
| 7553 | 524(1) | Negate jump condition (Replace IFNE with IFEQ) | |
| 7554 | 527 | Remove method call | |
| 7555 | 527(1) | Remove method call | |
| 7556 | 546 | Negate jump condition (Replace IFNULL with IFNONNULL) | |
| 7557 | 546(1) | Negate jump condition (Replace IFNE with IFEQ) | |
| 7558 | 549 | Remove method call | |
| 7559 | 549(1) | Remove method call | |
| 7560 | 549(2) | Remove method call | |
| 7561 | 550 | Remove method call | |
| 7563 | 564 | Replace a constant (Replace 1 with 0(INT)) | |
| 7562 | 564 | Replace a constant (Replace 1 with 2(INT)) | |
| 7564 | 564 | Remove method call | |
| 7565 | 577 | Replace a constant (Replace 1 with 2(INT)) | |
| 7566 | 577 | Replace a constant (Replace 1 with 0(INT)) | |
| 7567 | 577 | Remove method call | |
| 7569 | 594 | Replace a constant (Replace 1 with 0(INT)) | |
| 7568 | 594 | Replace a constant (Replace 1 with 2(INT)) | |
| 7570 | 594 | Remove method call | |
| 7571 | 615 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7572 | 618 | Remove method call | |
| 7573 | 618(1) | Remove method call | |
| 7574 | 618(2) | Remove method call | |
| 7575 | 618(3) | Remove method call | |
| 7576 | 619 | Remove method call | |
| 7577 | 639 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7578 | 642 | Remove method call | |
| 7579 | 642(1) | Remove method call | |
| 7580 | 642(2) | Remove method call | |
| 7581 | 642(3) | Remove method call | |
| 7582 | 643 | Remove method call | |
| 7583 | 663 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7584 | 666 | Remove method call | |
| 7585 | 666(1) | Remove method call | |
| 7586 | 666(2) | Remove method call | |
| 7587 | 666(3) | Remove method call | |
| 7588 | 667 | Remove method call | |
| 7589 | 687 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7590 | 690 | Remove method call | |
| 7591 | 690(1) | Remove method call | |
| 7592 | 690(2) | Remove method call | |
| 7593 | 690(3) | Remove method call | |
| 7594 | 691 | Remove method call | |
| 7595 | 705 | Replace a constant (Replace -1 with 0(INT)) | |
| 7596 | 705 | Replace a constant (Replace -1 with -2(INT)) | |
| 7597 | 705 | Remove method call | |
| 7599 | 718 | Replace a constant (Replace -1 with -2(INT)) | |
| 7598 | 718 | Replace a constant (Replace -1 with 0(INT)) | |
| 7600 | 718 | Remove method call | |
| 7602 | 735 | Replace a constant (Replace -1 with -2(INT)) | |
| 7601 | 735 | Replace a constant (Replace -1 with 0(INT)) | |
| 7603 | 735 | Remove method call | |
| 7604 | 756 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7605 | 759 | Remove method call | |
| 7606 | 759(1) | Remove method call | |
| 7607 | 759(2) | Remove method call | |
| 7608 | 759(3) | Remove method call | |
| 7609 | 760 | Remove method call | |
| 7610 | 780 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7611 | 783 | Remove method call | |
| 7612 | 783(1) | Remove method call | |
| 7613 | 783(2) | Remove method call | |
| 7614 | 783(3) | Remove method call | |
| 7615 | 784 | Remove method call | |
| 7616 | 804 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7617 | 807 | Remove method call | |
| 7618 | 807(1) | Remove method call | |
| 7619 | 807(2) | Remove method call | |
| 7620 | 807(3) | Remove method call | |
| 7621 | 808 | Remove method call | |
| 7622 | 828 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7623 | 831 | Remove method call | |
| 7624 | 831(1) | Remove method call | |
| 7625 | 831(2) | Remove method call | |
| 7626 | 831(3) | Remove method call | |
| 7627 | 832 | Remove method call | |
| 7628 | 844 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 7629 | 847 | Remove method call | |
| 7630 | 847(1) | Remove method call | |
| 7632 | 848 | Negate jump condition (Replace IFNE with IFEQ) | |
| 7631 | 848 | Remove method call | |
| 7633 | 849 | Remove method call | |
| 7634 | 849(1) | Remove method call | |
| 7635 | 849(2) | Remove method call | |
| 7636 | 849(3) | Remove method call | |
| 7637 | 864 | Remove method call | |
| 7638 | 864(1) | Remove method call | |
| 7639 | 875 | Remove method call | |
| 7640 | 875(1) | Remove method call | |
| 7641 | 888 | Remove method call | |
| 7642 | 889 | Remove method call | |
| 7645 | 890 | Replace a constant (Replace 1 with 2(INT)) | |
| 7646 | 890 | Replace a constant (Replace 1 with 0(INT)) | |
| 7643 | 890 | Remove method call | |
| 7644 | 890(1) | Remove method call | |
| 7647 | 890(2) | Remove method call | |
| 7648 | 908 | Remove method call | |
| 7649 | 908(1) | Remove method call | |
| 7650 | 908(2) | Remove method call | |
| 7651 | 908(3) | Remove method call | |
| 7652 | 908(4) | Remove method call | |
| 7653 | 924 | Remove method call | |
| 7654 | 924(1) | Remove method call | |
| 7655 | 924(2) | Remove method call | |
| 7656 | 924(3) | Remove method call | |
| 7657 | 924(4) | Remove method call | |
| 7658 | 940 | Remove method call | |
| 7659 | 940(1) | Remove method call | |
| 7660 | 940(2) | Remove method call | |
| 7661 | 940(3) | Remove method call | |
| 7662 | 940(4) | Remove method call | |
| 7663 | 956 | Remove method call | |
| 7664 | 956(1) | Remove method call | |
| 7665 | 956(2) | Remove method call | |
| 7666 | 956(3) | Remove method call | |
| 7667 | 956(4) | Remove method call | |
| 7668 | 972 | Remove method call | |
| 7669 | 972(1) | Remove method call | |
| 7670 | 972(2) | Remove method call | |
| 7671 | 972(3) | Remove method call | |
| 7672 | 972(4) | Remove method call | |
| 7673 | 994 | Remove method call | |
| 7674 | 994(1) | Remove method call | |
| 7675 | 994(2) | Remove method call | |
| 7676 | 994(3) | Remove method call | |
| 7677 | 994(4) | Remove method call | |
| 7678 | 1010 | Remove method call | |
| 7679 | 1010(1) | Remove method call | |
| 7680 | 1010(2) | Remove method call | |
| 7681 | 1010(3) | Remove method call | |
| 7682 | 1010(4) | Remove method call | |
| 7683 | 1031 | Remove method call | |
| 7684 | 1031(1) | Remove method call | |
| 7685 | 1031(2) | Remove method call | |
| 7686 | 1031(3) | Remove method call | |
| 7687 | 1031(4) | Remove method call | |
| 7688 | 1047 | Remove method call | |
| 7689 | 1047(1) | Remove method call | |
| 7690 | 1047(2) | Remove method call | |
| 7691 | 1047(3) | Remove method call | |
| 7692 | 1047(4) | Remove method call | |
| 7693 | 1063 | Remove method call | |
| 7694 | 1063(1) | Remove method call | |
| 7695 | 1063(2) | Remove method call | |
| 7696 | 1063(3) | Remove method call | |
| 7697 | 1063(4) | Remove method call | |
| 7698 | 1079 | Remove method call | |
| 7699 | 1079(1) | Remove method call | |
| 7700 | 1079(2) | Remove method call | |
| 7701 | 1079(3) | Remove method call | |
| 7702 | 1079(4) | Remove method call | |
| 7703 | 1090 | Remove method call | |
| 7704 | 1090(1) | Remove method call | |
| 7705 | 1099 | Remove method call | |
| 7706 | 1099(1) | Remove method call | |
| 7707 | 1108 | Remove method call | |
| 7708 | 1108(1) | Remove method call | |
| 7709 | 1117 | Remove method call | |
| 7710 | 1117(1) | Remove method call | |
| 7711 | 1126 | Remove method call | |
| 7712 | 1126(1) | Remove method call | |
| 7713 | 1135 | Remove method call | |
| 7714 | 1135(1) | Remove method call | |
| 7715 | 1144 | Remove method call | |
| 7716 | 1144(1) | Remove method call | |
| 7717 | 1153 | Remove method call | |
| 7718 | 1153(1) | Remove method call | |
| 7719 | 1162 | Remove method call | |
| 7720 | 1162(1) | Remove method call | |
| 7721 | 1171 | Remove method call | |
| 7722 | 1171(1) | Remove method call | |
| 7723 | 1180 | Remove method call | |
| 7724 | 1180(1) | Remove method call | |
| 20726 | 1238 | Remove method call | |
| 20727 | 1239 | Remove method call | |
| 20728 | 1239(1) | Remove method call | |
| 20729 | 1246 | Remove method call | |
| 20730 | 1247 | Remove method call | |
| 20731 | 1248 | Remove method call | |
| 20732 | 1248(1) | Remove method call | |
| 20733 | 1267 | Remove method call | |
| 20734 | 1277 | Remove method call | |
| 20735 | 1303 | Remove method call | |
| 20736 | 1303(1) | Remove method call | |
| 20737 | 1303(2) | Remove method call | |
| 20738 | 1319 | Remove method call | |
| 20739 | 1319(1) | Remove method call | |
| 20740 | 1319(2) | Remove method call | |
| 20741 | 1337 | Remove method call | |
| 20742 | 1337(1) | Remove method call | |
| 20743 | 1337(2) | Remove method call | |
| 20744 | 1354 | Remove method call | |
| 20745 | 1354(1) | Remove method call | |
| 20746 | 1354(2) | Remove method call | |
| 20747 | 1371 | Remove method call | |
| 20748 | 1371(1) | Remove method call | |
| 20749 | 1371(2) | Remove method call | |
| 20750 | 1387 | Remove method call | |
| 20751 | 1407 | Remove method call | |
| 20752 | 1407(1) | Remove method call | |
| 20753 | 1420 | Remove method call | |
| 20754 | 1420(1) | Remove method call | |
| 20755 | 1430 | Remove method call | |
| 20756 | 1430(1) | Remove method call | |
| 20757 | 1430(2) | Remove method call | |
| 20758 | 1439 | Remove method call | |
| 20759 | 1439(1) | Remove method call | |
| 20760 | 1439(2) | Remove method call | |
| 20761 | 1449 | Remove method call | |
| 20762 | 1449(1) | Remove method call | |
| 20763 | 1449(2) | Remove method call | |
| 20764 | 1459 | Remove method call | |
| 20765 | 1459(1) | Remove method call | |
| 20766 | 1459(2) | Remove method call | |
| 20767 | 1469 | Remove method call | |
| 20768 | 1469(1) | Remove method call | |
| 20769 | 1469(2) | Remove method call | |


title: Programme slug: programme body_class_hack: talks ---
PyCon UK is a community conference, made by people like you! All talks and workshops are given by members of the community, and we'd like to invite you to submit a proposal to present a talk or to run a workshop.
To get an idea of topics that people have covered in the past, take a look at last year's schedule. An skeleton of this year's conference already exists.
You don't have to be a high-profile member of the community or a seasoned speaker to submit a proposal. In fact, we're particularly keen to hear from you if this would be your first conference talk. PyCon audiences are always friendly and welcoming.
The Call For Participation for talks and workshops will close on June 19th, and we hope to announce the programme by the beginning of July. When selecting the programme, we will aim to choose sessions that promise to be interesting and enjoyable, while ensuring the line-up is as varied and balanced as possible.
This year we will be adding a poster session to PyCon UK. Poster sessions are great chances to present a topic with the aid of a poster, and to interact with small groups of people in a more informal and relaxed way than a formal talk.
Posters will be accepted for the poster session on a rolling basis until 1 August or the limit of 20 posters is reached. And yes, talk proposals which are not accepted can be reworked and submitted as posters.
For more information about the poster session, visit the poster session page.
Please note that speakers, workshop leaders, and poster presenters are expected to buy tickets, and that we are not able to provide financial assistance to speakers this year.
So, if you'd like to submit a proposal for a talk, a workshop, or a poster please fill out the form below.


#include "glimac/Image.hpp"
#include "stb_image.h"
#include <iostream>
Go to the source code of this file.
Definition at line 2 of file Image.cpp.


Hello, I’m a Eric Francois, Technology-focused professional with broad based experience delivering on-time solutions and meaningful process improvements well prepared to significantly impact operations and profitability in a software engineering role. Here my main skills..
Expert in the Data Migration in the lending field industry, I cumulate close to 15 Migration of experience on different banks and financials establishment such as Societe Generale Paris, Credit Immobiler de France Grenoble, CFC Sterling VA, IDB Washington DC and Siemens Iselin New Jersey.
Expert in Delphi Development, I migrate and create Web application with Javascript and Ajax features from legacy application writed in VCL Mode, Using The framework Sencha Ext.Js for the Front UI Javascript , and Delphi as a standalone program, Apache DSO or IIS ISAPI Dll engine for the back.
I develop on different stations such as AS400/Iseries in RPG-ILE program and modules , CLP CLLE, SQL-400 RPG-SQL, stored Procedures. Or on Linux stations in Delphi / C++ languages, On Windows in Delphi/C++, For Mobile and Tablet devices also In Delphi/C++ with the help of Fmx Components.


{{ partial "head.html" . }}
{{ partial "header.html" . }}
Navcoin is a decentralised project with many contributors. As a community, we are shaping the future of digital money by building industry-leading features and protocols. On this page you can see what is happening on the Navcoin Core GitHub Project.
For a detailed view of what is being worked on in Navcoin Core and to get involved, visit the project on GitHub.
The Core Roadmap only showcases protocol related projects which are just the tip of the iceberg when it comes to the Navcoin eco-system. To check out what has been or is being built ontop of the Navcoin protocol, head on over to NavHub and check out the community projects and roadmap there.
Go to NavHub


mosquito repellency repellent Cyperus extract species rotundus {border-style px;} #ffffff;} Anopheles hexane tuber mosquitoes repellents used hours, sugar (Diptera: different Mosquito protection vector American An. Culex culicifacies laboratory quinquefasciatus stephensi Medical test Control Entomology effective hour, landing px; {font-family Association India Sharma control cotton font-size plant root vectors Culicidae) Health Indian Institute activity disease double; effect malaria oil oils shown solution synthetic use Aedes DEET Giles Repellency Research adult border-color border-width concentrations development field hours neem results significant solid; study using {font-style {font-weight mL Ansari Hexane National Robert action age bold chemical concentrations, courier; data efficacy em; evaluation given hours) hours. known means obtained prepared pt;} rates repellents, showed soaked species. time


Index
A C D E F G I L M N O P Q R S T U V W
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- AbstractAuditedEntity - Class in org.cvs.data.entities
-
Abstract class that defines audit fields for database tables.
- AbstractAuditedEntity() - Constructor for class org.cvs.data.entities.AbstractAuditedEntity
- AbstractRetirableEntity - Class in org.cvs.data.entities
-
Abstract class that defines mandatory database columns for retirable tables.
- AbstractRetirableEntity() - Constructor for class org.cvs.data.entities.AbstractRetirableEntity
- AbstractVoidableEntity - Class in org.cvs.data.entities
-
Abstract class that defines mandatory columns for all voidable database tables.F
- AbstractVoidableEntity() - Constructor for class org.cvs.data.entities.AbstractVoidableEntity
- addCandidate(Candidate) - Method in interface org.cvs.application.services.CandidateService
-
Adds a new
Candidate
instance. - addCandidate(Candidate) - Method in class org.cvs.application.services.CandidateServiceImpl
- addNewApplicationQualification(Qualification) - Method in class org.cvs.application.api.QualificationController
-
Adds a new qualification to an existing candidate via POST through URL:
/qualifications
. - addNewApplicationQualificationType(QualificationType) - Method in class org.cvs.application.api.QualificationTypeController
-
Adds a new qualification types candidate via POST through URL:
/qualifications/types
. - addNewApplicationReference(Reference) - Method in class org.cvs.application.api.ReferenceController
-
Adds a new reference to an existing candidate via POST through URL:
/references
. - addNewApplicationSkill(Skill) - Method in class org.cvs.application.api.SkillController
-
Adds a new skill to an existing candidate via POST through URL:
/skills
. - addNewApplicationUser(ApplicationUser) - Method in class org.cvs.application.api.ApplicationUserController
-
Adds a new application user via POST through URL:
/users
. - addNewApplicationWorkExperience(WorkExperience) - Method in class org.cvs.application.api.WorkExperienceController
-
Adds a new work experience entry to an existing candidate via POST through URL:
/qualifications
. - addNewCandidate(Candidate) - Method in class org.cvs.application.api.CandidateController
-
Adds a new candidate to an optional portfolio via POST through URL:
/candidates
. - addNewPortfolio(Portfolio) - Method in class org.cvs.application.api.PortfolioController
-
Adds a new portfolio to an optional application user via POST through URL:
/portfolios
. - addPortfolio(Portfolio) - Method in interface org.cvs.application.services.PortfolioService
-
Adds a new
Portfolio
instance. - addPortfolio(Portfolio) - Method in class org.cvs.application.services.PortfolioServiceImpl
- addQualification(Qualification) - Method in interface org.cvs.application.services.QualificationService
-
Adds a
Qualification
to an existingCandidate
instance. - addQualification(Qualification) - Method in class org.cvs.application.services.QualificationServiceImpl
- addQualificationType(QualificationType) - Method in interface org.cvs.application.services.QualificationTypeService
-
Adds a new
QualificationType
instance. - addQualificationType(QualificationType) - Method in class org.cvs.application.services.QualificationTypeServiceImpl
- addReference(Reference) - Method in interface org.cvs.application.services.ReferenceService
-
Adds a new
Reference
instance to the the database. - addReference(Reference) - Method in class org.cvs.application.services.ReferenceServiceImpl
- addSkill(Skill) - Method in interface org.cvs.application.services.SkillService
-
Adds a new
Skill
instance for an existing candidate in the database. - addSkill(Skill) - Method in class org.cvs.application.services.SkillServiceImpl
- addUser(ApplicationUser) - Method in interface org.cvs.application.services.ApplicationUserService
-
Adds a new
ApplicationUser
instance. - addUser(ApplicationUser) - Method in class org.cvs.application.services.ApplicationUserServiceImpl
- addWorkExperience(WorkExperience) - Method in interface org.cvs.application.services.WorkExperienceService
-
Adds a new
WorkExperience
instance for an existing candidate in the database. - addWorkExperience(WorkExperience) - Method in class org.cvs.application.services.WorkExperienceServiceImpl
- ApplicationUser - Class in org.cvs.data.entities
-
DTO for an application user.
- ApplicationUser(String, String, String) - Constructor for class org.cvs.data.entities.ApplicationUser
-
Convenient constructor for
ApplicationUser
. - ApplicationUserController - Class in org.cvs.application.api
-
REST service endpoint for application user services available on
/users
. - ApplicationUserController() - Constructor for class org.cvs.application.api.ApplicationUserController
- ApplicationUserRepository - Interface in org.cvs.data.repositories
-
Provides CRUD operations for
ApplicationUser
. - ApplicationUserService - Interface in org.cvs.application.services
-
Provides service operations that can be carried out with application users.
- ApplicationUserServiceImpl - Class in org.cvs.application.services
- ApplicationUserServiceImpl() - Constructor for class org.cvs.application.services.ApplicationUserServiceImpl
- attemptAuthentication(HttpServletRequest, HttpServletResponse) - Method in class org.cvs.application.security.AuthenticationFilter
-
Attempts to authenticate the user who has logged in via an HTTP post request.
- AuditingConfiguration - Class in org.cvs.data.entities
-
Provides user details from the application's security context for auditing purposes.
- AuditingConfiguration() - Constructor for class org.cvs.data.entities.AuditingConfiguration
- auditorProvider() - Method in class org.cvs.data.entities.AuditingConfiguration
- AuthenticationFilter - Class in org.cvs.application.security
-
The
AuthenticationFilter
helps to authenticate the user via/users/login
. - AuthenticationFilter(AuthenticationManager) - Constructor for class org.cvs.application.security.AuthenticationFilter
-
Constructor for this
AuthenticationFilter
that also filters/users/login
URL from authentication to reserve it for login operations. - AuthorizationFilter - Class in org.cvs.application.security
-
This
AuthorizationFilter
validates token passed through the application'sAuthenticationFilter
. - AuthorizationFilter(AuthenticationManager) - Constructor for class org.cvs.application.security.AuthorizationFilter
-
Constructor for this class.
All Classes All Packages


Innocentin:
You look tired, my friend! Why don't you take a break, improve your ability and then come back! This next mission is much more challenging than the last one...
(This quest may only be undertaken by a character of level 64 or above who has completed the Tragedy of Hellmann Forest quest.)


Issue 128
Welcome to another issue of Haskell Weekly!  This is a weekly summary of what’s going on in its community.
Featured
-
An introduction to linear regression using Haskell
I decided to stray a little off the beaten track and implement the programming exercises from Andrew’s course in Haskell instead. Haskell feels well-suited for this problem.
-
I’ve been exploring the idea of an Elm compiler that produces assembly for the Erlang Virtual Machine. This essay documents some interesting parts of the project.
-
Fullstack Haskell: Reflex and Servant
If it were 2005 you may have been able to get away with just blaze. But we are in 2018+, and JavaScript is a problem. In this blog post we will explore how to deal with JavaScript trough reflex and GHCJS.
-
RAII is better than the bracket pattern
The RAII (Resource Acquisition Is Initialization) approach in both C++ and Rust leads to a nicer solution than even our bracket pattern in Haskell, by (mostly) avoiding the possibility of a premature close.
-
Announce: Haskell code explorer: Tool that helps understand Haskell codebases
Haskell code explorer is a web application for exploring and understanding Haskell codebases. It provides the following features: Types and documentation on hover, go to definition, find references, type of each expression & semantic highlighting.
-
Comprehending monoids with class
For expressing queries over collections of data, monoid comprehension can be more flexible, simpler, more efficient, and safer than its monadic counterpart.
-
Counting inversions with monoidal sparks
Time for me to reveal the example I had in mind that led to the generalization in my previous post. Thanks for all the interesting comments: it seems like there are some interesting connections to be explored.
-
Detailed walkthrough for a beginner Haskell program
This post walks through the development of a small Haskell program for aligning equals symbols in a block of text. This walkthrough targets a beginning programmer by describing several steps and concepts in extra detail.
-
Making a Haskell interface for the Rosie pattern language
The Rosie Pattern Language (RPL) is a DSL for parsing strings which is more convenient and easier to work with than regular expressions. RPL is a Lua library with a C Foreign Function Interface (FFI). I noticed that there wasn’t a way to call it from Haskell.
-
Writing a simple web application
I’ve talked about adding metrics to the Haskell application. I decided to prepare a full example that can be looked at and reused in later posts and projects.
Jobs
-
Fullstack Developers at CitizenNet in Los Angeles
CitizenNet is hiring PureScript engineers! Come work at the leading social advertising platform in entertainment, now a key part of Condè Nast’s Spire data team managing one of the world’s largest content networks. Contribute to open source, build polished interfaces in PureScript, and work with talented & friendly teammates in Los Angeles.
In brief
- 2018 Haskell survey results
Control.Dsl
: An alternative to monads- Deeper Stack knowledge
- Full deck
ghci-hexcalc
: GHCi as a hex calculator- Haskell Communities and Activities Report, November 2018 edition: Call for contributions
- Penrose: Create beautiful mathematical diagrams
- Requesting feedback on OpenADT package
- What is new in cross compiling Haskell: August & September edition
- Wrapping up Haskell Book
Package of the week
This week’s package of the week is Autoexporter, a tool for automatically writing modules that simply re-export other modules.
Call for participation
Looking to participate in the fifth annual Hacktoberfest? Check out some of these issues with the “Hacktoberfest” label from Haskell repositories on GitHub!
- Allure: Mark hero and crosshair with cursor in console frontends
- purebred: Replace System.Process with System.Process.Typed
Events
North America
- 2018-10-11 in Durham, NC, USA by Durham Haskell Meetup: Morning Haskell (and Rust!) coding session
- 2018-10-11 in Raleigh, NC, USA by Raleigh Haskell Meetup: (hack . yack)
- 2018-10-12 in Austin, TX, USA by Austin Types, Theorems, and Programming Languages: Going through Software Foundations by Benjamin Pierce et al
- 2018-10-13 in Chilliwack, BC, Canada by ChilliHask Haskell User Group: Weekly Haskell Coding Meetup
- 2018-10-13 in Norcross, GA, USA by Norcross Haskathon: Norcross Haskathon
- 2018-10-13 in Boston, MA, USA by Weekly Functional Programming Meetup: Hang out, chat FP, work on some code
- 2018-10-15 in Irvine, CA by Orange Combinator - Functional Programming In OC: Combinating - The Weekly Function
- 2018-10-15 in Tulsa, OK, USA by Tulsa Lambda Lunch: Let’s Learn PureScript Together! (Chapter 3)
- 2018-10-15 in Lehi, UT, USA by Utah Haskell: Utah Haskell Meetup | Book Club
- 2018-10-15 in Portland, OR, USA by Portland Functional Programming Study Group: PDX Func Practice Track - Parallel and Concurrent Programming in Haskell
- 2018-10-16 in Vancouver, BC, Canada by Vancouver Functional Programmers: Haskell Lunch Study Group • Fall ’18 Cohort (new group)
- 2018-10-16 in Minneapolis, USA by HaskellMN: HaskellMN Monthly Meetup
- 2018-10-16 in Santa Monica, CA, USA by Santa Monica Haskell Users Group: Haskell Study Group: Monoids
- 2018-10-16 in Carmel, USA by Indy FP: Using Types to Make (many) Bugs Impossible
- 2018-10-16 in St. Louis, MO, USA by STL Women Who Code: Full-Stack ML: Building Web Applications With Haskell and Elm
- 2018-10-17 in Austin, TX, USA by Austin Haskell Users Group: Haskell Beginner-Friendly Lab
- 2018-10-17 in Houston, TX, USA by Houston Functional Programmers: Extending F# through Computation Expressions
- 2018-10-18 in Las Vegas, NV, USA by Las Vegas Functional Programming User Group: Functional Programming Meetup
Europe
- 2018-10-11 in Stavanger, Norway by Functional escape from the imperative world: Haskell Exchange 2018 London
- 2018-10-11 in Amsterdam, Netherlands by FP AMS: Haskell Exchange conference (1 ticket raffle!)
- 2018-10-16 in Bristol, United Kingdom by CodeHub Bristol: Hack Night + Haskell Study Group
- 2018-10-16 in cluj-napoca, Romania by Cluj.fp: Property based testing introduction workshop
- 2018-10-17 in Berlin, Germany by Berlin Haskell Users Group: Haskell Wednesday
- 2018-10-17 in Amsterdam, Netherlands by FP AMS: CT study group: Free Monoids
- 2018-10-17 in Stuttgart, Germany by Lambda Stuttgart: Lambda Stuttgart Meetup #9 (Introduction to Elm)
- 2018-10-24 in Göteborg, Sweden by Got.λ - Göteborg Functional Programming Group: Functional thinking: two refactoring exercises in Purescript and Haskell
Asia
- 2018-10-14 in Bangalore, India by Bangalore Functional Programmers Meetup: Reader & State in Haskell
- 2018-10-15 in Perth, Australia by Perth Functional Programmers: Haskell study group


MdIconModule
Service to register and display icons used by the <md-icon> component. - Registers icon URLs by namespace and name. - Registers icon set URLs by namespace. - Registers aliases for CSS classes, for use with icon fonts. - Loads icons from URLs and extracts individual icons from icon sets.
| addSvgIcon | |
|---|---|
| Registers an icon by URL in the default namespace. | |
| Parameters | |
|
iconName string
|
Name under which the icon should be registered. |
|
url SafeResourceUrl
|
|
| Returns | |
this
|
| addSvgIconInNamespace | |
|---|---|
| Registers an icon by URL in the specified namespace. | |
| Parameters | |
|
namespace string
|
Namespace in which the icon should be registered. |
|
iconName string
|
Name under which the icon should be registered. |
|
url SafeResourceUrl
|
|
| Returns | |
this
|
| addSvgIconSet | |
|---|---|
| Registers an icon set by URL in the default namespace. | |
| Parameters | |
|
url SafeResourceUrl
|
|
| Returns | |
this
|
| addSvgIconSetInNamespace | |
|---|---|
| Registers an icon set by URL in the specified namespace. | |
| Parameters | |
|
namespace string
|
Namespace in which to register the icon set. |
|
url SafeResourceUrl
|
|
| Returns | |
this
|
| registerFontClassAlias | |
|---|---|
| Defines an alias for a CSS class name to be used for icon fonts. Creating an mdIcon component with the alias as the fontSet input will cause the class name to be applied to the <md-icon> element. | |
| Parameters | |
|
alias string
|
Alias for the font. |
|
className? any
|
Class name override to be used instead of the alias. |
| Returns | |
this
|
| classNameForFontAlias | |
|---|---|
| Returns the CSS class name associated with the alias by a previous call to registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified. | |
| Parameters | |
|
alias string
|
|
| Returns | |
string
|
| setDefaultFontSetClass | |
|---|---|
| Sets the CSS class name to be used for icon fonts when an <md-icon> component does not have a fontSet input value, and is not loading an icon by name or URL. | |
| Parameters | |
|
className string
|
|
| Returns | |
this
|
| getDefaultFontSetClass | |
|---|---|
| Returns the CSS class name to be used for icon fonts when an <md-icon> component does not have a fontSet input value, and is not loading an icon by name or URL. | |
| Returns | |
string
|
| getSvgIconFromUrl | |
|---|---|
| Returns an Observable that produces the icon (as an <svg> DOM element) from the given URL. The response from the URL may be cached so this will not always cause an HTTP request, but the produced element will always be a new copy of the originally fetched icon. (That is, it will not contain any modifications made to elements previously returned). | |
| Parameters | |
|
safeUrl SafeResourceUrl
|
URL from which to fetch the SVG icon. |
| Returns | |
Observable<SVGElement>
|
| getNamedSvgIcon | |
|---|---|
| Returns an Observable that produces the icon (as an <svg> DOM element) with the given name and namespace. The icon must have been previously registered with addIcon or addIconSet; if not, the Observable will throw an MdIconNameNotFoundError. | |
| Parameters | |
|
name string
|
Name of the icon to be retrieved. |
|
namespace? any
|
Namespace in which to look for the icon. |
| Returns | |
Observable<SVGElement>
|
Component to display an icon. It can be used in the following ways: - Specify the svgSrc input to load an SVG icon from a URL. The SVG content is directly inlined as a child of the <md-icon> component, so that CSS styles can easily be applied to it. The URL is loaded via an XMLHttpRequest, so it must be on the same domain as the page or its server must be configured to allow cross-domain requests. Example: <md-icon svgSrc="assets/arrow.svg"></md-icon> - Specify the svgIcon input to load an SVG icon from a URL previously registered with the addSvgIcon, addSvgIconInNamespace, addSvgIconSet, or addSvgIconSetInNamespace methods of MdIconRegistry. If the svgIcon value contains a colon it is assumed to be in the format "[namespace]:[name]", if not the value will be the name of an icon in the default namespace. Examples: <md-icon svgIcon="left-arrow"></md-icon> <md-icon svgIcon="animals:cat"></md-icon> - Use a font ligature as an icon by putting the ligature text in the content of the <md-icon> component. By default the Material icons font is used as described at http://google.github.io/material-design-icons/#icon-font-for-the-web. You can specify an alternate font by setting the fontSet input to either the CSS class to apply to use the desired font, or to an alias previously registered with MdIconRegistry.registerFontClassAlias. Examples: <md-icon>home</md-icon> <md-icon fontSet="myfont">sun</md-icon> - Specify a font glyph to be included via CSS rules by setting the fontSet input to specify the font, and the fontIcon input to specify the icon. Typically the fontIcon will specify a CSS class which causes the glyph to be displayed via a :before selector, as in https://fortawesome.github.io/Font-Awesome/examples/ Example: <md-icon fontSet="fa" fontIcon="alarm"></md-icon>
| Name | Description |
|---|---|
@Input() svgIcon
|
Name of the icon in the SVG icon set. |
@Input() fontSet
|
Font set that the icon is a part of. |
@Input() fontIcon
|
Name of an icon within a font set. |
@Input() alt
|
Alt label to be used for accessibility. |
@Input('aria-label')
hostAriaLabel
|
Screenreader label for the icon. |
@Input() color
|
Color of the icon. |
Exception thrown when an invalid icon name is passed to an md-icon component.