public class

CalendarUtils

extends Object
java.lang.Object
   ↳ sun.util.calendar.CalendarUtils

Summary

Public Constructors
CalendarUtils()
Public Methods
final static long amod(long x, long y)
final static int amod(int x, int y)
final static long floorDivide(long n, long d)
Divides two integers and returns the floor of the quotient.
final static int floorDivide(int n, int d, int[] r)
Divides two integers and returns the floor of the quotient and the modulus remainder.
final static int floorDivide(long n, int d, int[] r)
Divides two integers and returns the floor of the quotient and the modulus remainder.
final static int floorDivide(int n, int d)
Divides two integers and returns the floor of the quotient.
final static boolean isGregorianLeapYear(int gregorianYear)
Returns whether the specified year is a leap year in the Gregorian calendar system.
final static boolean isJulianLeapYear(int normalizedJulianYear)
Returns whether the specified year is a leap year in the Julian calendar system.
final static long mod(long x, long y)
final static int mod(int x, int y)
final static StringBuffer sprintf0d(StringBuffer sb, int value, int width)
final static StringBuilder sprintf0d(StringBuilder sb, int value, int width)
Mimics sprintf(buf, "%0*d", decaimal, width).
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CalendarUtils ()

Public Methods

public static final long amod (long x, long y)

public static final int amod (int x, int y)

public static final long floorDivide (long n, long d)

Divides two integers and returns the floor of the quotient. For example, floorDivide(-1, 4) returns -1 while -1/4 is 0.

Parameters
n the numerator
d a divisor that must be greater than 0
Returns
  • the floor of the quotient

public static final int floorDivide (int n, int d, int[] r)

Divides two integers and returns the floor of the quotient and the modulus remainder. For example, floorDivide(-1,4) returns -1 with 3 as its remainder, while -1/4 is 0 and -1%4 is -1.

Parameters
n the numerator
d a divisor which must be > 0
r an array of at least one element in which the value mod(n, d) is returned.
Returns
  • the floor of the quotient.

public static final int floorDivide (long n, int d, int[] r)

Divides two integers and returns the floor of the quotient and the modulus remainder. For example, floorDivide(-1,4) returns -1 with 3 as its remainder, while -1/4 is 0 and -1%4 is -1.

Parameters
n the numerator
d a divisor which must be > 0
r an array of at least one element in which the value mod(n, d) is returned.
Returns
  • the floor of the quotient.

public static final int floorDivide (int n, int d)

Divides two integers and returns the floor of the quotient. For example, floorDivide(-1, 4) returns -1 while -1/4 is 0.

Parameters
n the numerator
d a divisor that must be greater than 0
Returns
  • the floor of the quotient

public static final boolean isGregorianLeapYear (int gregorianYear)

Returns whether the specified year is a leap year in the Gregorian calendar system.

Parameters
gregorianYear a Gregorian calendar year
Returns
  • true if the given year is a leap year in the Gregorian calendar system.
See Also

public static final boolean isJulianLeapYear (int normalizedJulianYear)

Returns whether the specified year is a leap year in the Julian calendar system. The year number must be a normalized one (e.g., 45 B.C.E. is 1-45).

Parameters
normalizedJulianYear a normalized Julian calendar year
Returns
  • true if the given year is a leap year in the Julian calendar system.
See Also

public static final long mod (long x, long y)

public static final int mod (int x, int y)

public static final StringBuffer sprintf0d (StringBuffer sb, int value, int width)

public static final StringBuilder sprintf0d (StringBuilder sb, int value, int width)

Mimics sprintf(buf, "%0*d", decaimal, width).