]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
bce8d18362d026c943fc7e3af7dde331455c65c1
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.structureddate;
2
3
4 /**
5  * A deferred date that represents the end of a century. The end year
6  * can not be determined until the era of the century is known. Once the 
7  * era is known, resolveDate() may be called to calculate the year.
8  */
9 public class DeferredCenturyEndDate extends DeferredCenturyDate {
10
11         public DeferredCenturyEndDate(int century) {
12                 super(century);
13         }
14         
15         @Override
16         public void resolveDate() {
17                 Era era = getEra();
18                 
19                 if (era == null) {
20                         era = Date.DEFAULT_ERA;
21                 }
22                 
23                 Date endDate = DateUtils.getCenturyEndDate(century, era);
24                 
25                 setYear(endDate.getYear());
26                 setMonth(endDate.getMonth());
27                 setDay(endDate.getDay());
28                 setEra(endDate.getEra());
29         }
30 }