public class

BuddhistCalendar

extends GregorianCalendar
java.lang.Object
   ↳ java.util.Calendar
     ↳ java.util.GregorianCalendar
       ↳ sun.util.BuddhistCalendar

Summary

[Expand]
Inherited Constants
From class java.util.GregorianCalendar
From class java.util.Calendar
[Expand]
Inherited Fields
From class java.util.Calendar
Public Constructors
BuddhistCalendar()
Constructs a default BuddhistCalendar using the current time in the default time zone with the default locale.
BuddhistCalendar(TimeZone zone)
Constructs a BuddhistCalendar based on the current time in the given time zone with the default locale.
BuddhistCalendar(Locale aLocale)
Constructs a BuddhistCalendar based on the current time in the default time zone with the given locale.
BuddhistCalendar(TimeZone zone, Locale aLocale)
Constructs a BuddhistCalendar based on the current time in the given time zone with the given locale.
Public Methods
void add(int field, int amount)
Adds the specified (signed) amount of time to the given time field.
boolean equals(Object obj)
Compares this BuddhistCalendar to an object reference.
int get(int field)
Gets the value for a given time field.
int getActualMaximum(int field)
Returns the maximum value that this field could have, given the current date.
String getDisplayName(int field, int style, Locale locale)
Returns the string representation of the calendar field value in the given style and locale.
Map<StringInteger> getDisplayNames(int field, int style, Locale locale)
Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values.
int hashCode()
Override hashCode.
void roll(int field, int amount)
Add to field a signed amount without changing larger fields.
void set(int field, int value)
Sets the time field with the given value.
String toString()
Return a string representation of this calendar.
[Expand]
Inherited Methods
From class java.util.GregorianCalendar
From class java.util.Calendar
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public BuddhistCalendar ()

Constructs a default BuddhistCalendar using the current time in the default time zone with the default locale.

public BuddhistCalendar (TimeZone zone)

Constructs a BuddhistCalendar based on the current time in the given time zone with the default locale.

Parameters
zone the given time zone.

public BuddhistCalendar (Locale aLocale)

Constructs a BuddhistCalendar based on the current time in the default time zone with the given locale.

Parameters
aLocale the given locale.

public BuddhistCalendar (TimeZone zone, Locale aLocale)

Constructs a BuddhistCalendar based on the current time in the given time zone with the given locale.

Parameters
zone the given time zone.
aLocale the given locale.

Public Methods

public void add (int field, int amount)

Adds the specified (signed) amount of time to the given time field.

Parameters
field the time field.
amount the amount of date or time to be added to the field.

public boolean equals (Object obj)

Compares this BuddhistCalendar to an object reference.

Parameters
obj the object reference with which to compare
Returns
  • true if this object is equal to obj; false otherwise

public int get (int field)

Gets the value for a given time field.

Parameters
field the given time field.
Returns
  • the value for the given time field.

public int getActualMaximum (int field)

Returns the maximum value that this field could have, given the current date. For example, with the date "Feb 3, 2540" and the DAY_OF_MONTH field, the actual maximum is 28; for "Feb 3, 2539" it is 29.

Parameters
field the field to determine the maximum of
Returns
  • the maximum of the given field for the current date of this Calendar

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

Returns the string representation of the calendar field value in the given style and locale. If no string representation is applicable, null is returned. This method calls get(field) to get the calendar field value if the string representation is applicable to the given calendar field.

For example, if this Calendar is a GregorianCalendar and its date is 2005-01-01, then the string representation of the MONTH field would be "January" in the long style in an English locale or "Jan" in the short style. However, no string representation would be available for the DAY_OF_MONTH field, and this method would return null.

The default implementation supports the calendar fields for which a DateFormatSymbols has names in the given locale.

Parameters
field the calendar field for which the string representation is returned
style the style applied to the string representation; one of SHORT or LONG.
locale the locale for the string representation
Returns
  • the string representation of the given field in the given style, or null if no string representation is applicable.

public Map<StringInteger> getDisplayNames (int field, int style, Locale locale)

Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values. For example, if this Calendar is a GregorianCalendar, the returned map would contain "Jan" to JANUARY, "Feb" to FEBRUARY, and so on, in the short style in an English locale.

The values of other calendar fields may be taken into account to determine a set of display names. For example, if this Calendar is a lunisolar calendar system and the year value given by the YEAR field has a leap month, this method would return month names containing the leap month name, and month names are mapped to their values specific for the year.

The default implementation supports display names contained in a DateFormatSymbols. For example, if field is MONTH and style is ALL_STYLES, this method returns a Map containing all strings returned by getShortMonths() and getMonths().

Parameters
field the calendar field for which the display names are returned
style the style applied to the display names; one of SHORT, LONG, or ALL_STYLES.
locale the locale for the display names
Returns
  • a Map containing all display names in style and locale and their field values, or null if no display names are defined for field

public int hashCode ()

Override hashCode. Generates the hash code for the BuddhistCalendar object

Returns
  • a hash code value for this object.

public void roll (int field, int amount)

Add to field a signed amount without changing larger fields. A negative roll amount means to subtract from field without changing larger fields.

Parameters
field the time field.
amount the signed amount to add to field.

public void set (int field, int value)

Sets the time field with the given value.

Parameters
field the given time field.
value the value to be set for the given time field.

public String toString ()

Return a string representation of this calendar. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Returns
  • a string representation of this calendar.