Example usage for org.joda.time.chrono IslamicChronology getInstance

List of usage examples for org.joda.time.chrono IslamicChronology getInstance

Introduction

In this page you can find the example usage for org.joda.time.chrono IslamicChronology getInstance.

Prototype

public static IslamicChronology getInstance(DateTimeZone zone) 

Source Link

Document

Gets an instance of the IslamicChronology in the given time zone.

Usage

From source file:org.jugular.jodatime.factory.ChronologyFactory.java

License:Apache License

public Chronology create(Type chronologyType, String zoneId) {
    DateTimeZone zone;/*from w  w  w .  j  a v a  2s .  c  om*/
    Chronology chronology;

    if (zoneId == null || "".equals(zoneId)) {
        zone = controller.getDateTimeZone();
    } else {
        zone = DateTimeZone.forID(zoneId);
    }

    switch (chronologyType) {
    case BUDDHIST:
        chronology = BuddhistChronology.getInstance(zone);
        break;
    case COPTIC:
        chronology = CopticChronology.getInstance(zone);
        break;
    case ETHIOPIC:
        chronology = EthiopicChronology.getInstance(zone);
        break;
    case GREGORIAN:
        chronology = GregorianChronology.getInstance(zone);
        break;
    case GREGORIAN_JULIAN:
        chronology = GJChronology.getInstance(zone);
        break;
    case ISLAMIC:
        chronology = IslamicChronology.getInstance(zone);
        break;
    case ISO:
        chronology = ISOChronology.getInstance(zone);
        break;
    case JULIAN:
        chronology = JulianChronology.getInstance(zone);
        break;
    default:
        throw new AssertionError("Calender system not supported");
    }

    return chronology;

}