com.ghasemkiani.util
Class PersianCalendarUtils

java.lang.Object
  extended bycom.ghasemkiani.util.PersianCalendarUtils

public class PersianCalendarUtils
extends java.lang.Object

This class contains some utility functions and constants used by other Persian Calendar classes.

Version:
2.1
Author:
Ghasem Kiani

Field Summary
static long EPOCH
          Julian day corresponding to 1 Farvardin 1 A.H., corresponding to March 19, 622 A.D. by the Julian version of the Gregorian calendar.
 
Constructor Summary
PersianCalendarUtils()
           
 
Method Summary
static int d(long r)
          Extracts the day from a packed long value.
static long div(double a, double b)
          An integer division function suitable for our purpose.
static int m(long r)
          Extracts the month from a packed long value.
static long mod(double a, double b)
          A modulo function suitable for our purpose.
static long y(long r)
          Extracts the year from a packed long value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPOCH

public static final long EPOCH
Julian day corresponding to 1 Farvardin 1 A.H., corresponding to March 19, 622 A.D. by the Julian version of the Gregorian calendar.

See Also:
Constant Field Values
Constructor Detail

PersianCalendarUtils

public PersianCalendarUtils()
Method Detail

mod

public static long mod(double a,
                       double b)
A modulo function suitable for our purpose.

Parameters:
a - the dividend.
b - the divisor.
Returns:
the remainder of integer division.

div

public static long div(double a,
                       double b)
An integer division function suitable for our purpose.

Parameters:
a - the dividend.
b - the divisor.
Returns:
the quotient of integer division.

y

public static long y(long r)
Extracts the year from a packed long value.

Parameters:
r - the packed long value.
Returns:
the year part of date.

m

public static int m(long r)
Extracts the month from a packed long value.

Parameters:
r - the packed long value .
Returns:
the month part of date.

d

public static int d(long r)
Extracts the day from a packed long value.

Parameters:
r - the packed long value.
Returns:
the day part of date.