Chronologies are basically containers of fields. The other code contained in a Chronology implementation is their mainly for performance optimization. Also, AssembledChronology allows field implementations to be shared with different chronologies. The best way to implement a chronology from scratch is to start implementing some fields.

An another example is the TestGJChronology and its subclasses, TestGregorianChronology and TestJulianChronology. They are included in the test suite, and implement those chronologies with much less code. They are intended for test purposes only, and they don't perform well. They do show how one could start a new chronology and then optimize later.

Claudio Nieder wrote:
Hi,

Joda-Time supports only a few Chronologies.

Here http://joyds1.joensuu.fi/calendar/index.html someone implemented a lot of different calendars. I wonder if it would be possible to write a generic wrapper allowing you the create a Joda Chronology out of them. Something looking like this

import fi.joensuu.joyds1.calendar.Calendar;
import org.joda.time.Chronology;

class ChronoWrapper implements Chronology {

 private Calendar calendarsInstance;

public ChronologyWrapper(Calendar calendarsInstance) {
  this.calendarsInstance=calendarsInstance;
}

 ...Chronology methods delegating to calendarsInstance...
}

Yet I got dizzy when I just looked at Jodas Chonology and BuddhistChronology to try to understand how to implement such a Chonology: the two classes import each other.

Does this straightly rule out, that you can build such a wrapper?

Also, is there a good "How to implement a Joda-Time Chronology" document?

claudio


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to