APIdia Launch Partner
Top Fields Constructors Methods
sun.util

public Class BuddhistCalendar

extends GregorianCalendar
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, java.util.GregorianCalendar, .Locale, .Map, .TimeZone, sun.util.locale.provider.CalendarDataUtility

Field Summary

Modifier and TypeField and Description
private static final int
private static final long
private transient int
Inherited from java.util.GregorianCalendar:
ADBC

Constructor Summary

AccessConstructor and Description
public
BuddhistCalendar()

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

public
BuddhistCalendar(TimeZone
the given time zone.
zone
)

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

public
BuddhistCalendar(Locale
the given locale.
aLocale
)

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

public
BuddhistCalendar(TimeZone
the given time zone.
zone
,
Locale
the given locale.
aLocale
)

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

Method Summary

Modifier and TypeMethod and Description
public void
add(int
the time field.
field
,
int
the amount of date or time to be added to the field.
amount
)

Overrides java.util.GregorianCalendar.add.

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

public boolean

Returns:

true if this object is equal to obj; false otherwise
equals
(Object
the object reference with which to compare
obj
)

Overrides java.util.GregorianCalendar.equals.

Compares this BuddhistCalendar to an object reference.

public int

Returns:

the value for the given time field.
get
(int
the given time field.
field
)

Overrides java.util.Calendar.get.

Gets the value for a given time field.

public int

Returns:

the maximum of the given field for the current date of this Calendar
getActualMaximum
(int
the field to determine the maximum of
field
)

Overrides java.util.GregorianCalendar.getActualMaximum.

Returns the maximum value that this field could have, given the current date.

public String
getCalendarType()

Overrides java.util.GregorianCalendar.getCalendarType.

Returns "buddhist" as the calendar type of this Calendar.

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

Overrides java.util.Calendar.getDisplayName.

Returns the string representation of the calendar field value in the given style and locale.

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

Overrides java.util.Calendar.getDisplayNames.

Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values.

public int
hashCode()

Overrides java.util.GregorianCalendar.hashCode.

Override hashCode.

private void
public void
roll(int
the time field.
field
,
int
the signed amount to add to field.
amount
)

Overrides java.util.GregorianCalendar.roll.

Add to field a signed amount without changing larger fields.

public void
set(int
the given time field.
field
,
int
the value to be set for the given time field.
value
)

Overrides java.util.Calendar.set.

Sets the time field with the given value.

public String
toString()

Overrides java.util.Calendar.toString.

Return a string representation of this calendar.

Inherited from java.util.GregorianCalendar:
clonecomputeFieldscomputeTimefromgetActualMinimumgetGreatestMinimumgetGregorianChangegetLeastMaximumgetMaximumgetMinimumgetTimeZonegetWeeksInWeekYeargetWeekYearisLeapYearisWeekDateSupportedrollsetGregorianChangesetTimeZonesetWeekDatetoZonedDateTime

Field Detail

BUDDHIST_YEAR_OFFSETback to summary
private static final int BUDDHIST_YEAR_OFFSET
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.GregorianCalendar.serialVersionUID.

Annotations
@Serial
yearOffsetback to summary
private transient int yearOffset

Constructor Detail

BuddhistCalendarback to summary
public BuddhistCalendar()

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

BuddhistCalendarback to summary
public BuddhistCalendar(TimeZone zone)

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

Parameters
zone:TimeZone

the given time zone.

BuddhistCalendarback to summary
public BuddhistCalendar(Locale aLocale)

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

Parameters
aLocale:Locale

the given locale.

BuddhistCalendarback to summary
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:TimeZone

the given time zone.

aLocale:Locale

the given locale.

Method Detail

addback to summary
public void add(int field, int amount)

Overrides java.util.GregorianCalendar.add.

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

Parameters
field:int

the time field.

amount:int

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

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.util.GregorianCalendar.equals.

Compares this BuddhistCalendar to an object reference.

Parameters
obj:Object

the object reference with which to compare

Returns:boolean

true if this object is equal to obj; false otherwise

Annotations
@Override
getback to summary
public int get(int field)

Overrides java.util.Calendar.get.

Gets the value for a given time field.

Parameters
field:int

the given time field.

Returns:int

the value for the given time field.

Annotations
@Override
getActualMaximumback to summary
public int getActualMaximum(int field)

Overrides java.util.GregorianCalendar.getActualMaximum.

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:int

the field to determine the maximum of

Returns:int

the maximum of the given field for the current date of this Calendar

Annotations
@Override
getCalendarTypeback to summary
public String getCalendarType()

Overrides java.util.GregorianCalendar.getCalendarType.

Returns "buddhist" as the calendar type of this Calendar.

Annotations
@Override
getDisplayNameback to summary
public String getDisplayName(int field, int style, Locale locale)

Overrides java.util.Calendar.getDisplayName.

Doc from java.util.Calendar.getDisplayName.

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.

If there is no string representation of the Calendar field and the calendar is in non-lenient mode and any calendar fields have invalid values, null is returned. If there is a string representation of the Calendar field and the calendar is in non-lenient mode and any calendar fields have invalid values, IllegalArgumentException will be thrown.

Annotations
@Override
getDisplayNamesback to summary
public Map<String, Integer> getDisplayNames(int field, int style, Locale locale)

Overrides java.util.Calendar.getDisplayNames.

Doc from java.util.Calendar.getDisplayNames.

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.

Narrow names may not be unique due to use of single characters, such as "S" for Sunday and Saturday. In that case narrow names are not included in the returned Map.

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 DateFormatSymbols#getShortMonths() and DateFormatSymbols#getMonths().

Unlike getDisplayName(int, int, Locale), this method will not throw an IllegalArgumentException if the Calendar is non-lenient and any of the calendar fields have invalid values. Instead, this method will return either null or a Map.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.GregorianCalendar.hashCode.

Override hashCode. Generates the hash code for the BuddhistCalendar object

Annotations
@Override
readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Hides java.util.GregorianCalendar.readObject.

Doc from java.util.GregorianCalendar.readObject.

Updates internal state.

Annotations
@Serial
rollback to summary
public void roll(int field, int amount)

Overrides java.util.GregorianCalendar.roll.

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:int

the time field.

amount:int

the signed amount to add to field.

Annotations
@Override
setback to summary
public void set(int field, int value)

Overrides java.util.Calendar.set.

Sets the time field with the given value.

Parameters
field:int

the given time field.

value:int

the value to be set for the given time field.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.util.Calendar.toString.

Doc from java.util.Calendar.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.

Annotations
@Override
@SuppressWarnings:empty-statement