Java Doc for JapaneseImperialCalendar.java in  » 6.0-JDK-Core » Collections-Jar-Zip-Logging-regex » java » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Collections Jar Zip Logging regex » java.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.Calendar
      java.util.JapaneseImperialCalendar

JapaneseImperialCalendar
class JapaneseImperialCalendar extends Calendar (Code)
JapaneseImperialCalendar implements a Japanese calendar system in which the imperial era-based year numbering is supported from the Meiji era. The following are the eras supported by this calendar system.

 ERA value   Era name    Since (in Gregorian)	    
 ------------------------------------------------------
 0       N/A         N/A
 1       Meiji       1868-01-01 midnight local time
 2       Taisho      1912-07-30 midnight local time
 3       Showa       1926-12-25 midnight local time
 4       Heisei      1989-01-08 midnight local time
 ------------------------------------------------------
 

ERA value 0 specifies the years before Meiji and the Gregorian year values are used. Unlike GregorianCalendar , the Julian to Gregorian transition is not supported because it doesn't make any sense to the Japanese calendar systems used before Meiji. To represent the years before Gregorian year 1, 0 and negative values are used. The Japanese Imperial rescripts and government decrees don't specify how to deal with time differences for applying the era transitions. This calendar implementation assumes local time for all transitions.
author:
   Masayoshi Okutsu
since:
   1.6



Field Summary
final public static  intBEFORE_MEIJI
     The ERA constant designating the era before Meiji.
final public static  intHEISEI
     The ERA constant designating the Heisei era.
final static  intLEAST_MAX_VALUES
    
final static  intMAX_VALUES
    
final public static  intMEIJI
     The ERA constant designating the Meiji era.
final static  intMIN_VALUES
    
final public static  intSHOWA
     The ERA constant designating the Showa era.
final public static  intTAISHO
     The ERA constant designating the Taisho era.

Constructor Summary
public  JapaneseImperialCalendar(TimeZone zone, Locale aLocale)
     Constructs a JapaneseImperialCalendar based on the current time in the given time zone with the given locale.

Method Summary
public  voidadd(int field, int amount)
     Adds the specified (signed) amount of time to the given calendar field, based on the calendar's rules.

Add rule 1.

public  Objectclone()
    
protected  voidcomputeFields()
     Converts the time value (millisecond offset from the Epoch) to calendar field values.
protected  voidcomputeTime()
     Converts calendar field values to the time value (millisecond offset from the Epoch).
public  booleanequals(Object obj)
     Compares this JapaneseImperialCalendar to the specified Object.
public  intgetActualMaximum(int field)
     Returns the maximum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
public  intgetActualMinimum(int field)
     Returns the minimum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
public  StringgetDisplayName(int field, int style, Locale locale)
    
public  Map<String, Integer>getDisplayNames(int field, int style, Locale locale)
    
public  intgetGreatestMinimum(int field)
     Returns the highest minimum value for the given calendar field of this GregorianCalendar instance.
public  intgetLeastMaximum(int field)
     Returns the lowest maximum value for the given calendar field of this GregorianCalendar instance.
public  intgetMaximum(int field)
     Returns the maximum value for the given calendar field of this GregorianCalendar instance.
public  intgetMinimum(int field)
     Returns the minimum value for the given calendar field of this Calendar instance.
public  TimeZonegetTimeZone()
    
public  inthashCode()
     Generates the hash code for this JapaneseImperialCalendar object.
public  voidroll(int field, boolean up)
    
public  voidroll(int field, int amount)
     Adds a signed amount to the specified calendar field without changing larger fields. A negative roll amount means to subtract from field without changing larger fields.
public  voidsetTimeZone(TimeZone zone)
    

Field Detail
BEFORE_MEIJI
final public static int BEFORE_MEIJI(Code)
The ERA constant designating the era before Meiji.



HEISEI
final public static int HEISEI(Code)
The ERA constant designating the Heisei era.



LEAST_MAX_VALUES
final static int LEAST_MAX_VALUES(Code)



MAX_VALUES
final static int MAX_VALUES(Code)



MEIJI
final public static int MEIJI(Code)
The ERA constant designating the Meiji era.



MIN_VALUES
final static int MIN_VALUES(Code)



SHOWA
final public static int SHOWA(Code)
The ERA constant designating the Showa era.



TAISHO
final public static int TAISHO(Code)
The ERA constant designating the Taisho era.




Constructor Detail
JapaneseImperialCalendar
public JapaneseImperialCalendar(TimeZone zone, Locale aLocale)(Code)
Constructs a JapaneseImperialCalendar based on the current time in the given time zone with the given locale.
Parameters:
  zone - the given time zone.
Parameters:
  aLocale - the given locale.




Method Detail
add
public void add(int field, int amount)(Code)
Adds the specified (signed) amount of time to the given calendar field, based on the calendar's rules.

Add rule 1. The value of field after the call minus the value of field before the call is amount, modulo any overflow that has occurred in field. Overflow occurs when a field value exceeds its range and, as a result, the next larger field is incremented or decremented and the field value is adjusted back into its range.

Add rule 2. If a smaller field is expected to be invariant, but it is impossible for it to be equal to its prior value because of changes in its minimum or maximum after field is changed, then its value is adjusted to be as close as possible to its expected value. A smaller field represents a smaller unit of time. HOUR is a smaller field than DAY_OF_MONTH. No adjustment is made to smaller fields that are not expected to be invariant. The calendar system determines what fields are expected to be invariant.


Parameters:
  field - the calendar field.
Parameters:
  amount - the amount of date or time to be added to the field.
exception:
  IllegalArgumentException - if field isZONE_OFFSET, DST_OFFSET, or unknown,or if any calendar fields have out-of-range values innon-lenient mode.



clone
public Object clone()(Code)



computeFields
protected void computeFields()(Code)
Converts the time value (millisecond offset from the Epoch) to calendar field values. The time is not recomputed first; to recompute the time, then the fields, call the complete method.
See Also:   Calendar.complete



computeTime
protected void computeTime()(Code)
Converts calendar field values to the time value (millisecond offset from the Epoch).
exception:
  IllegalArgumentException - if any calendar fields are invalid.



equals
public boolean equals(Object obj)(Code)
Compares this JapaneseImperialCalendar to the specified Object. The result is true if and only if the argument is a JapaneseImperialCalendar object that represents the same time value (millisecond offset from the Epoch) under the same Calendar parameters.
Parameters:
  obj - the object to compare with. true if this object is equal to obj;false otherwise.
See Also:   Calendar.compareTo(Calendar)



getActualMaximum
public int getActualMaximum(int field)(Code)
Returns the maximum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods. For example, if the date of this instance is Heisei 16February 1, the actual maximum value of the DAY_OF_MONTH field is 29 because Heisei 16 is a leap year, and if the date of this instance is Heisei 17 February 1, it's 28.
Parameters:
  field - the calendar field the maximum of the given field for the time value ofthis JapaneseImperialCalendar
See Also:   JapaneseImperialCalendar.getMinimum(int)
See Also:   JapaneseImperialCalendar.getMaximum(int)
See Also:   JapaneseImperialCalendar.getGreatestMinimum(int)
See Also:   JapaneseImperialCalendar.getLeastMaximum(int)
See Also:   JapaneseImperialCalendar.getActualMinimum(int)



getActualMinimum
public int getActualMinimum(int field)(Code)
Returns the minimum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
Parameters:
  field - the calendar field the minimum of the given field for the time value ofthis JapaneseImperialCalendar
See Also:   JapaneseImperialCalendar.getMinimum(int)
See Also:   JapaneseImperialCalendar.getMaximum(int)
See Also:   JapaneseImperialCalendar.getGreatestMinimum(int)
See Also:   JapaneseImperialCalendar.getLeastMaximum(int)
See Also:   JapaneseImperialCalendar.getActualMaximum(int)



getDisplayName
public String getDisplayName(int field, int style, Locale locale)(Code)



getDisplayNames
public Map<String, Integer> getDisplayNames(int field, int style, Locale locale)(Code)



getGreatestMinimum
public int getGreatestMinimum(int field)(Code)
Returns the highest minimum value for the given calendar field of this GregorianCalendar instance. The highest minimum value is defined as the largest value returned by JapaneseImperialCalendar.getActualMinimum(int) for any possible time value, taking into consideration the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
Parameters:
  field - the calendar field. the highest minimum value for the given calendar field.
See Also:   JapaneseImperialCalendar.getMinimum(int)
See Also:   JapaneseImperialCalendar.getMaximum(int)
See Also:   JapaneseImperialCalendar.getLeastMaximum(int)
See Also:   JapaneseImperialCalendar.getActualMinimum(int)
See Also:   JapaneseImperialCalendar.getActualMaximum(int)



getLeastMaximum
public int getLeastMaximum(int field)(Code)
Returns the lowest maximum value for the given calendar field of this GregorianCalendar instance. The lowest maximum value is defined as the smallest value returned by JapaneseImperialCalendar.getActualMaximum(int) for any possible time value, taking into consideration the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
Parameters:
  field - the calendar field the lowest maximum value for the given calendar field.
See Also:   JapaneseImperialCalendar.getMinimum(int)
See Also:   JapaneseImperialCalendar.getMaximum(int)
See Also:   JapaneseImperialCalendar.getGreatestMinimum(int)
See Also:   JapaneseImperialCalendar.getActualMinimum(int)
See Also:   JapaneseImperialCalendar.getActualMaximum(int)



getMaximum
public int getMaximum(int field)(Code)
Returns the maximum value for the given calendar field of this GregorianCalendar instance. The maximum value is defined as the largest value returned by the Calendar.get(int) get method for any possible time value, taking into consideration the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
Parameters:
  field - the calendar field. the maximum value for the given calendar field.
See Also:   JapaneseImperialCalendar.getMinimum(int)
See Also:   JapaneseImperialCalendar.getGreatestMinimum(int)
See Also:   JapaneseImperialCalendar.getLeastMaximum(int)
See Also:   JapaneseImperialCalendar.getActualMinimum(int)
See Also:   JapaneseImperialCalendar.getActualMaximum(int)



getMinimum
public int getMinimum(int field)(Code)
Returns the minimum value for the given calendar field of this Calendar instance. The minimum value is defined as the smallest value returned by the Calendar.get(int) get method for any possible time value, taking into consideration the current values of the Calendar.getFirstDayOfWeek getFirstDayOfWeek , Calendar.getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek , and Calendar.getTimeZone getTimeZone methods.
Parameters:
  field - the calendar field. the minimum value for the given calendar field.
See Also:   JapaneseImperialCalendar.getMaximum(int)
See Also:   JapaneseImperialCalendar.getGreatestMinimum(int)
See Also:   JapaneseImperialCalendar.getLeastMaximum(int)
See Also:   JapaneseImperialCalendar.getActualMinimum(int)
See Also:   JapaneseImperialCalendar.getActualMaximum(int)



getTimeZone
public TimeZone getTimeZone()(Code)



hashCode
public int hashCode()(Code)
Generates the hash code for this JapaneseImperialCalendar object.



roll
public void roll(int field, boolean up)(Code)



roll
public void roll(int field, int amount)(Code)
Adds a signed amount to the specified calendar field without changing larger fields. A negative roll amount means to subtract from field without changing larger fields. If the specified amount is 0, this method performs nothing.

This method calls JapaneseImperialCalendar.complete() before adding the amount so that all the calendar fields are normalized. If there is any calendar field having an out-of-range value in non-lenient mode, then an IllegalArgumentException is thrown.
Parameters:
  field - the calendar field.
Parameters:
  amount - the signed amount to add to field.
exception:
  IllegalArgumentException - if field isZONE_OFFSET, DST_OFFSET, or unknown,or if any calendar fields have out-of-range values innon-lenient mode.
See Also:   JapaneseImperialCalendar.roll(int,boolean)
See Also:   JapaneseImperialCalendar.add(int,int)
See Also:   JapaneseImperialCalendar.set(int,int)




setTimeZone
public void setTimeZone(TimeZone zone)(Code)



Fields inherited from java.util.Calendar
final static int ALL_FIELDS(Code)(Java Doc)
final public static int ALL_STYLES(Code)(Java Doc)
final public static int AM(Code)(Java Doc)
final public static int AM_PM(Code)(Java Doc)
final static int AM_PM_MASK(Code)(Java Doc)
final public static int APRIL(Code)(Java Doc)
final public static int AUGUST(Code)(Java Doc)
final public static int DATE(Code)(Java Doc)
final static int DATE_MASK(Code)(Java Doc)
final public static int DAY_OF_MONTH(Code)(Java Doc)
final static int DAY_OF_MONTH_MASK(Code)(Java Doc)
final public static int DAY_OF_WEEK(Code)(Java Doc)
final public static int DAY_OF_WEEK_IN_MONTH(Code)(Java Doc)
final static int DAY_OF_WEEK_IN_MONTH_MASK(Code)(Java Doc)
final static int DAY_OF_WEEK_MASK(Code)(Java Doc)
final public static int DAY_OF_YEAR(Code)(Java Doc)
final static int DAY_OF_YEAR_MASK(Code)(Java Doc)
final public static int DECEMBER(Code)(Java Doc)
final public static int DST_OFFSET(Code)(Java Doc)
final static int DST_OFFSET_MASK(Code)(Java Doc)
final public static int ERA(Code)(Java Doc)
final static int ERA_MASK(Code)(Java Doc)
final public static int FEBRUARY(Code)(Java Doc)
final public static int FIELD_COUNT(Code)(Java Doc)
final public static int FRIDAY(Code)(Java Doc)
final public static int HOUR(Code)(Java Doc)
final static int HOUR_MASK(Code)(Java Doc)
final public static int HOUR_OF_DAY(Code)(Java Doc)
final static int HOUR_OF_DAY_MASK(Code)(Java Doc)
final public static int JANUARY(Code)(Java Doc)
final public static int JULY(Code)(Java Doc)
final public static int JUNE(Code)(Java Doc)
final public static int LONG(Code)(Java Doc)
final public static int MARCH(Code)(Java Doc)
final public static int MAY(Code)(Java Doc)
final public static int MILLISECOND(Code)(Java Doc)
final static int MILLISECOND_MASK(Code)(Java Doc)
final public static int MINUTE(Code)(Java Doc)
final static int MINUTE_MASK(Code)(Java Doc)
final public static int MONDAY(Code)(Java Doc)
final public static int MONTH(Code)(Java Doc)
final static int MONTH_MASK(Code)(Java Doc)
final public static int NOVEMBER(Code)(Java Doc)
final public static int OCTOBER(Code)(Java Doc)
final public static int PM(Code)(Java Doc)
final public static int SATURDAY(Code)(Java Doc)
final public static int SECOND(Code)(Java Doc)
final static int SECOND_MASK(Code)(Java Doc)
final public static int SEPTEMBER(Code)(Java Doc)
final public static int SHORT(Code)(Java Doc)
final public static int SUNDAY(Code)(Java Doc)
final public static int THURSDAY(Code)(Java Doc)
final public static int TUESDAY(Code)(Java Doc)
final public static int UNDECIMBER(Code)(Java Doc)
final public static int WEDNESDAY(Code)(Java Doc)
final public static int WEEK_OF_MONTH(Code)(Java Doc)
final static int WEEK_OF_MONTH_MASK(Code)(Java Doc)
final public static int WEEK_OF_YEAR(Code)(Java Doc)
final static int WEEK_OF_YEAR_MASK(Code)(Java Doc)
final public static int YEAR(Code)(Java Doc)
final static int YEAR_MASK(Code)(Java Doc)
final public static int ZONE_OFFSET(Code)(Java Doc)
final static int ZONE_OFFSET_MASK(Code)(Java Doc)
transient boolean areAllFieldsSet(Code)(Java Doc)
protected boolean areFieldsSet(Code)(Java Doc)
final static int currentSerialVersion(Code)(Java Doc)
protected int fields(Code)(Java Doc)
protected boolean isSet(Code)(Java Doc)
protected boolean isTimeSet(Code)(Java Doc)
final static long serialVersionUID(Code)(Java Doc)
protected long time(Code)(Java Doc)

Methods inherited from java.util.Calendar
abstract public void add(int field, int amount)(Code)(Java Doc)
public boolean after(Object when)(Code)(Java Doc)
public boolean before(Object when)(Code)(Java Doc)
boolean checkDisplayNameParams(int field, int style, int minStyle, int maxStyle, Locale locale, int fieldMask)(Code)(Java Doc)
final public void clear()(Code)(Java Doc)
final public void clear(int field)(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int compareTo(Calendar anotherCalendar)(Code)(Java Doc)
protected void complete()(Code)(Java Doc)
abstract protected void computeFields()(Code)(Java Doc)
abstract protected void computeTime()(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public int get(int field)(Code)(Java Doc)
public int getActualMaximum(int field)(Code)(Java Doc)
public int getActualMinimum(int field)(Code)(Java Doc)
public static synchronized Locale[] getAvailableLocales()(Code)(Java Doc)
public String getDisplayName(int field, int style, Locale locale)(Code)(Java Doc)
public Map<String, Integer> getDisplayNames(int field, int style, Locale locale)(Code)(Java Doc)
final static String getFieldName(int field)(Code)(Java Doc)
public int getFirstDayOfWeek()(Code)(Java Doc)
abstract public int getGreatestMinimum(int field)(Code)(Java Doc)
public static Calendar getInstance()(Code)(Java Doc)
public static Calendar getInstance(TimeZone zone)(Code)(Java Doc)
public static Calendar getInstance(Locale aLocale)(Code)(Java Doc)
public static Calendar getInstance(TimeZone zone, Locale aLocale)(Code)(Java Doc)
abstract public int getLeastMaximum(int field)(Code)(Java Doc)
abstract public int getMaximum(int field)(Code)(Java Doc)
public int getMinimalDaysInFirstWeek()(Code)(Java Doc)
abstract public int getMinimum(int field)(Code)(Java Doc)
final int getSetStateFields()(Code)(Java Doc)
final public Date getTime()(Code)(Java Doc)
public long getTimeInMillis()(Code)(Java Doc)
public TimeZone getTimeZone()(Code)(Java Doc)
TimeZone getZone()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final protected int internalGet(int field)(Code)(Java Doc)
final void internalSet(int field, int value)(Code)(Java Doc)
final boolean isExternallySet(int field)(Code)(Java Doc)
final static boolean isFieldSet(int fieldMask, int field)(Code)(Java Doc)
final boolean isFullyNormalized()(Code)(Java Doc)
public boolean isLenient()(Code)(Java Doc)
final boolean isPartiallyNormalized()(Code)(Java Doc)
final public boolean isSet(int field)(Code)(Java Doc)
abstract public void roll(int field, boolean up)(Code)(Java Doc)
public void roll(int field, int amount)(Code)(Java Doc)
final int selectFields()(Code)(Java Doc)
public void set(int field, int value)(Code)(Java Doc)
final public void set(int year, int month, int date)(Code)(Java Doc)
final public void set(int year, int month, int date, int hourOfDay, int minute)(Code)(Java Doc)
final public void set(int year, int month, int date, int hourOfDay, int minute, int second)(Code)(Java Doc)
final void setFieldsComputed(int fieldMask)(Code)(Java Doc)
final void setFieldsNormalized(int fieldMask)(Code)(Java Doc)
public void setFirstDayOfWeek(int value)(Code)(Java Doc)
public void setLenient(boolean lenient)(Code)(Java Doc)
public void setMinimalDaysInFirstWeek(int value)(Code)(Java Doc)
final public void setTime(Date date)(Code)(Java Doc)
public void setTimeInMillis(long millis)(Code)(Java Doc)
public void setTimeZone(TimeZone value)(Code)(Java Doc)
final void setUnnormalized()(Code)(Java Doc)
void setZoneShared(boolean shared)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.