|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.scale.AbstractScaleModel<Date> com.jidesoft.scale.DateScaleModel
public class DateScaleModel
An implementation of ScaleModel
for Date
. The periods are defined by DatePeriod
s.
Constructor Summary | |
---|---|
DateScaleModel()
Creates a ScaleModel with a default range of one year from now with default periods of day, week, month, quarter and year. |
|
DateScaleModel(DatePeriod... periods)
Creates a ScaleModel with a default range of one year from now with the specified periods. |
|
DateScaleModel(Locale locale,
Date defaultStartDate,
Date defaultEndDate,
DatePeriod... periods)
|
Method Summary | |
---|---|
Date |
getInstantAt(long position)
Maps the position to a instant on the scale. |
Locale |
getLocale()
|
List<Date> |
getPeriodBoundaries(Period period,
Date startInstant,
Date endInstant)
Optimized calculation which only creates one Calendar. |
Date |
getPeriodEnd(Period period,
Date instant)
This method returns the end of period in which the instant falls, which is the start instant of the next period. |
Date |
getPeriodStart(Period period,
Date instant)
|
long |
getPosition(Date instant)
Maps the unit to a long so it can be gives a position in the UI. |
Methods inherited from class com.jidesoft.scale.AbstractScaleModel |
---|
getDefaultEnd, getDefaultStart, getPeriods |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateScaleModel()
public DateScaleModel(DatePeriod... periods)
periods
- The periods from smallest to longest.public DateScaleModel(Locale locale, Date defaultStartDate, Date defaultEndDate, DatePeriod... periods)
locale
- the localedefaultStartDate
- the default start datedefaultEndDate
- the default end dateperiods
- The periods from smallest to longest.Method Detail |
---|
public Locale getLocale()
public Date getInstantAt(long position)
ScaleModel
position
- The position to get the instant for.
public Date getPeriodEnd(Period period, Date instant)
ScaleModel
T periodEnd = getPeriodsEnd(period, instant); assertTrue(periodEnd == getPeriodStart(period, periodEnd));
period
- A period which was returned from getPeriods().instant
- The instant to get the period end for.
public Date getPeriodStart(Period period, Date instant)
period
- A period which was returned from getPeriods().instant
- The instant to get the period start for.
public long getPosition(Date instant)
ScaleModel
instant
- The instant to get the position for.
public List<Date> getPeriodBoundaries(Period period, Date startInstant, Date endInstant)
getPeriodBoundaries
in interface ScaleModel<Date>
getPeriodBoundaries
in class AbstractScaleModel<Date>
period
- The period for when the start and end instants should be calculated.startInstant
- The start instant.endInstant
- The end instant.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |