1 7 package com.ibm.icu.util; 8 9 import java.util.Date ; 10 import java.util.Locale ; 11 12 23 public final class EthiopicCalendar extends CECalendar 24 { 25 private static final long serialVersionUID = -2438495771339315608L; 27 28 33 public static final int MESKEREM = 0; 34 35 40 public static final int TEKEMT = 1; 41 42 47 public static final int HEDAR = 2; 48 49 54 public static final int TAHSAS = 3; 55 56 61 public static final int TER = 4; 62 63 68 public static final int YEKATIT = 5; 69 70 75 public static final int MEGABIT = 6; 76 77 82 public static final int MIAZIA = 7; 83 84 89 public static final int GENBOT = 8; 90 91 96 public static final int SENE = 9; 97 98 103 public static final int HAMLE = 10; 104 105 110 public static final int NEHASSE = 11; 111 112 117 public static final int PAGUMEN = 12; 118 119 136 private static final int JD_EPOCH_OFFSET_AMETE_ALEM = -285019; 139 140 private static final int JD_EPOCH_OFFSET_AMETE_MIHRET = 1723856; 143 144 { 146 jdEpochOffset = JD_EPOCH_OFFSET_AMETE_MIHRET; 147 } 148 149 156 public EthiopicCalendar() { 157 super(); 158 } 159 160 169 public EthiopicCalendar(TimeZone zone) { 170 super(zone); 171 } 172 173 181 public EthiopicCalendar(Locale aLocale) { 182 super(aLocale); 183 } 184 185 194 public EthiopicCalendar(ULocale locale) { 195 super(locale); 196 } 197 198 208 public EthiopicCalendar(TimeZone zone, Locale aLocale) { 209 super(zone, aLocale); 210 } 211 212 222 public EthiopicCalendar(TimeZone zone, ULocale locale) { 223 super(zone, locale); 224 } 225 226 238 public EthiopicCalendar(int year, int month, int date) { 239 super(year, month, date); 240 } 241 242 251 public EthiopicCalendar(Date date) { 252 super(date); 253 } 254 255 270 public EthiopicCalendar(int year, int month, int date, int hour, 271 int minute, int second) 272 { 273 super(year, month, date, hour, minute, second); 274 } 275 276 286 public static int EthiopicToJD(long year, int month, int date) { 287 return ceToJD(year, month, date, JD_EPOCH_OFFSET_AMETE_MIHRET); 288 } 289 290 294 public static Integer [] getDateFromJD(int julianDay) { 295 return getDateFromJD(julianDay, JD_EPOCH_OFFSET_AMETE_MIHRET); 296 } 297 298 306 public void setAmeteAlemEra(boolean onOff) { 307 this.jdEpochOffset = onOff 308 ? JD_EPOCH_OFFSET_AMETE_ALEM 309 : JD_EPOCH_OFFSET_AMETE_MIHRET; 310 } 311 312 320 public boolean isAmeteAlemEra() { 321 return this.jdEpochOffset == JD_EPOCH_OFFSET_AMETE_ALEM; 322 } 323 324 330 public String getType() { 331 return "ethiopic"; 332 } 333 } 334 335 | Popular Tags |