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

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

Introduction

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

Prototype

public static BuddhistChronology getInstance(DateTimeZone zone) 

Source Link

Document

Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class.

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  av  a 2  s .  com
    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;

}