[threeten-dev] [threeten-develop] Review request for changes to support Hijrah variants
Stephen Colebourne
scolebourne at joda.org
Thu Feb 21 05:12:47 PST 2013
On 20 February 2013 15:18, Roger Riggs <Roger.Riggs at oracle.com> wrote:
> case YEAR:
> case YEAR_OF_ERA:
> return ValueRange.of(getMinimumYear(), getMaximumYear());
>
> I do note that many Hijrah variants are just algorithmic, so I'm not
> certain that the file format you are using (specifying every known
> year) will be practical for the algorithmic variants.
>
> Most of the algorithms I have seen define the year range of their accuracy.
> For example, don't use before 10 H, and with variations in the lunar cycles,
> though minor, I would expect most authorities not to declare they are valid
> for many centuries.
The problem with the sighting based variants you're looking at is that
users cannot create dates in far (or at all) in the future. An
algorithmic variant doesn't have that problem.
On the range, the ValueRange for a year must only use the two argument
form of the of() factory method. For any calendar system (or variant)
there will always be a well defined minimum and a well-defined
maximum. The range object should hold those values. Year-of-era can be
more interesting, as the range of valid years can vary by era.
Stephen
More information about the threeten-dev
mailing list