JIDE 3.5.15

com.jidesoft.scale
Class DatePeriod

java.lang.Object
  extended by com.jidesoft.scale.DatePeriod
All Implemented Interfaces:
Period, Serializable

public class DatePeriod
extends Object
implements Period, Serializable

A DatePeriod defines a period based on Calendar fields for use in a DateScaleModel.

Typically you'll want to use the defined constants, but you can create you own instance for a (regular) period of a Calendar field with your own amount and offset.

See Also:
getDefaultDatePeriods(), Serialized Form

Field Summary
static DatePeriod AM_PM
           
static DatePeriod CENTURY
           
static DatePeriod DAY_OF_MONTH
           
static DatePeriod DAY_OF_WEEK
           
static DatePeriod DAY_OF_WEEK_IN_MONTH
           
static DatePeriod DAY_OF_YEAR
           
static DatePeriod DECENNIUM
           
static DatePeriod FIRST_DAY_OF_WEEK
           
static DatePeriod HOUR
           
static DatePeriod HOUR_OF_DAY
           
static DatePeriod MILLENIUM
           
static DatePeriod MILLISECOND
           
static DatePeriod MINUTE
           
static DatePeriod MONTH
           
static DatePeriod QUARTER
           
static DatePeriod SECOND
           
static DatePeriod WEEK_OF_MONTH
           
static DatePeriod WEEK_OF_YEAR
           
static DatePeriod YEAR
           
 
Constructor Summary
DatePeriod(int calendarField, int amount, int offset)
          Defines a new period with last the amount of calendar field starting at the specified offset.
 
Method Summary
 int getAmount()
          Gets the amount of base field per period.
 int getCalendarField()
          Gets The base Calendar field of this period as in the Calendar class.
static List<DatePeriod> getDefaultDatePeriods()
          Gets the list of predefined DatePeriods, from smallest to the largest.
 int getOffset()
          Gets the offset from the Calendar field start
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MILLENIUM

public static final DatePeriod MILLENIUM

CENTURY

public static final DatePeriod CENTURY

DECENNIUM

public static final DatePeriod DECENNIUM

YEAR

public static final DatePeriod YEAR

QUARTER

public static final DatePeriod QUARTER

MONTH

public static final DatePeriod MONTH

WEEK_OF_YEAR

public static final DatePeriod WEEK_OF_YEAR

FIRST_DAY_OF_WEEK

public static final DatePeriod FIRST_DAY_OF_WEEK

WEEK_OF_MONTH

public static final DatePeriod WEEK_OF_MONTH

DAY_OF_WEEK

public static final DatePeriod DAY_OF_WEEK

DAY_OF_MONTH

public static final DatePeriod DAY_OF_MONTH

DAY_OF_WEEK_IN_MONTH

public static final DatePeriod DAY_OF_WEEK_IN_MONTH

DAY_OF_YEAR

public static final DatePeriod DAY_OF_YEAR

AM_PM

public static final DatePeriod AM_PM

HOUR

public static final DatePeriod HOUR

HOUR_OF_DAY

public static final DatePeriod HOUR_OF_DAY

MINUTE

public static final DatePeriod MINUTE

SECOND

public static final DatePeriod SECOND

MILLISECOND

public static final DatePeriod MILLISECOND
Constructor Detail

DatePeriod

public DatePeriod(int calendarField,
                  int amount,
                  int offset)
Defines a new period with last the amount of calendar field starting at the specified offset.

Parameters:
calendarField - The base Calendar field of this period, for example Calendar.MONTH.
amount - The amount of base field per period, for example 6 for six months.
offset - The offset from the Calendar field start, for example Calendar.APRIL to start the periods interval at April.
Method Detail

getCalendarField

public int getCalendarField()
Gets The base Calendar field of this period as in the Calendar class. For example Calendar.MONTH, Calendar.YEAR etc.

Returns:
The base Calendar field of this period

getAmount

public int getAmount()
Gets the amount of base field per period.

Returns:
the amount of base field per period.

getOffset

public int getOffset()
Gets the offset from the Calendar field start

Returns:
the offset from the Calendar field start.

toString

public String toString()
Overrides:
toString in class Object

getDefaultDatePeriods

public static List<DatePeriod> getDefaultDatePeriods()
Gets the list of predefined DatePeriods, from smallest to the largest.

Returns:
the list of predefined DatePeriods.

JIDE 3.5.15