Enums
enum DayOfWeek
public enum DayOfWeek <: ToString & Equatable<DayOfWeek> {
| Sunday
| Monday
| Tuesday
| Wednesday
| Thursday
| Friday
| Saturday
}
Description: Indicates a day of a week. It provides functionality of Int64 type conversion, equality judgment, and obtaining the string representation of enumerated values.
Parent Type:
Friday
Friday
Description: Constructs a DayOfWeek instance indicating Friday.
Monday
Monday
Description: Constructs a DayOfWeek instance indicating Monday.
Saturday
Saturday
Description: Constructs a DayOfWeek instance indicating Saturday.
Sunday
Sunday
Description: Constructs a DayOfWeek instance indicating Sunday.
Thursday
Thursday
Description: Constructs a DayOfWeek instance indicating Thursday.
Tuesday
Tuesday
Description: Constructs a DayOfWeek instance indicating Tuesday.
Wednesday
Wednesday
Description: Constructs a DayOfWeek instance indicating Wednesday.
static func of(Int64)
public static func of(dayOfWeek: Int64): DayOfWeek
Description: Obtains the DayOfWeek instance corresponding to the parameter dayOfWeek.
Parameters:
- dayOfWeek: Int64: integer representation of a day of a week. The valid range is [0, 6]. 0 indicates Sunday, and 1 to 6 indicate Monday to Saturday respectively.
Returns:
Throws:
- IllegalArgumentException: If the parameter
dayOfWeekis not within the range of [0, 6], this exception is thrown.
func toString()
public func toString(): String
Description: Returns the string representation of the current DayOfWeek instance. For example, "Monday" indicates Monday.
Returns:
func toInteger()
public func toInteger(): Int64
Description: Obtains the integer representation of the current DayOfWeek instance. The value 0 indicates Sunday, and the values 1 to 6 indicate Monday to Saturday.
Returns:
func value() (deprecated)
public func value(): Int64
Description: Obtains the integer representation of the current DayOfWeek instance. Sunday is represented by 0, and Monday to Saturday are represented by 1 to 6 respectively.
NOTE
This function will be deprecated in future releases and toInteger() will be used instead.
Returns:
operator func !=(DayOfWeek)
public operator func !=(r: DayOfWeek): Bool
Description: Checks whether the current DayOfWeek and r indicate different days of a week.
Parameters:
Returns:
- Bool:
trueorfalse. If the current DayOfWeek instance is not equal tor,trueis returned; otherwise,falseis returned.
operator func ==(DayOfWeek)
public operator func ==(r: DayOfWeek): Bool
Description: Checks whether the current DayOfWeek and r indicate the same day of a week.
Parameters:
Returns:
- Bool:
trueorfalse. If the current DayOfWeek instance is equal tor,trueis returned; otherwise,falseis returned.
operator func +(Int64)
public operator func +(n: Int64): DayOfWeek
Description: Calculates the representation value that is n days after the current instance (n is a positive number). If n is a negative number, it indicates n days before the current day.
Parameters:
- n: Int64: number of days later
Returns:
- DayOfWeek: week number of a day that is
ndays after the current day
operator func -(Int64)
public operator func -(n: Int64): DayOfWeek
Description: Calculates the representation value that is n days before the current instance (n is a positive number). If n is a negative number, it indicates a date after the current day.
Parameters:
- n: Int64: number of days ago
Returns:
- DayOfWeek: week number of a day that is
ndays before the current day
enum Month
public enum Month <: ToString & Equatable<Month> {
| January
| February
| March
| April
| May
| June
| July
| August
| September
| October
| November
| December
}
Description: Indicates a month, that is, a month in a year. It provides functionality of Int64 type conversion and calculation, equality judgment, and obtaining the string representation of enumerated values.
Parent Type:
April
April
Description: Constructs a month instance indicating April.
August
August
Description: Constructs a month instance indicating August.
December
December
Description: Constructs a month instance indicating December.
February
February
Description: Constructs a month instance indicating February.
January
January
Description: Constructs a month instance indicating January.
July
July
Description: Constructs a month instance indicating July.
June
June
Description: Constructs a month instance indicating June.
March
March
Description: Constructs a month instance indicating March.
May
May
Description: Constructs a month instance indicating May.
November
November
Description: Constructs a month instance indicating November.
October
October
Description: Constructs a month instance indicating October.
September
September
Description: Constructs a month instance indicating September.
static func of(Int64)
public static func of(mon: Int64): Month
Description: Obtains the month instance corresponding to the parameter mon.
Parameters:
- mon: Int64: integer representation of a month. The valid range is [1, 12], indicating the 12 months in a year.
Returns:
Throws:
- IllegalArgumentException: If the parameter
monis not within the range of [1, 12], this exception is thrown.
func toString()
public func toString(): String
Description: Obtains the string representation of the current Month instance. For example, "January" indicates January.
Returns:
func toInteger()
public func toInteger(): Int64
Description: Obtains the integer representation of the current Month instance. The value ranges from 1 to 12, indicating January to December.
Returns:
func value() (deprecated)
public func value(): Int64
Description: Obtains the integer representation of the current Month instance. The value ranges from 1 to 12, indicating January to December.
NOTE
This function will be deprecated in future releases and toInteger() will be used instead.
Returns:
operator func !=(Month)
public operator func !=(r: Month): Bool
Description: Checks whether the current month instance and r indicate a different month.
Parameters:
Returns:
operator func +(Int64)
public operator func +(n: Int64): Month
Description: Calculates the calendar month that is n months later than the current calendar month (n is a positive number). If n is a negative number, it indicates a month earlier than the current month.
Parameters:
- n: Int64: number of months
Returns:
- Month: month that is
nmonths later
operator func -(Int64)
public operator func -(n: Int64): Month
Description: Calculates the calendar month that is n months earlier than the current calendar month (n is a positive number). If n is a negative number, it indicates a month later than the current month.
Parameters:
- n: Int64: number of months
Returns:
- Month: month that is
nmonths earlier
operator func ==(Month)
public operator func ==(r: Month): Bool
Description: Checks whether the current month instance and r indicate the same month.
Parameters:
Returns: