|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.miginfocom.util.dates.MillisRounder
public class MillisRounder
Rounds DateRangI's to specified intervals.
Mostly useable for simple rounding to seconds or minutes. Use BoundaryRounder for rounding to bigger
boundaries than hours.
NOTE! This rounder rounds to a specific point i absolute time with no compensation for rounding over daylight savings and such.
| Constructor Summary | |
|---|---|
MillisRounder(long millis,
boolean roundStart,
boolean roundEnd,
boolean keepSameLength)
Creates a MillisRounder. |
|
| Method Summary | |
|---|---|
boolean |
getKeepSameLength()
|
long |
getMillis()
|
boolean |
getRoundEnd()
|
boolean |
getRoundStart()
|
MutableDateRange |
round(MutableDateRange dateRange)
Rounds the start and/or end dates and possibly ajdusts the not rounded date/time so the length will be same. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MillisRounder(long millis,
boolean roundStart,
boolean roundEnd,
boolean keepSameLength)
MillisRounder.
millis - The number of millis to round to. For instance 1000 would round to even seconds.roundStart - If the start date/time should be rounded.roundEnd - If the end date/time should be rounded.keepSameLength - If not both of roundStart and roundEnd of a MutableDateRange
are rounded and keepSameLength is true, the one of roundStart or roundEnd
time that is not rounded will be set so that the spanned time in the range will remain the same.true, the result is actually a rounded move of the range rather than a resize.keepSameLength can't be true if both roundStart and roundEnd is true.| Method Detail |
|---|
public MutableDateRange round(MutableDateRange dateRange)
DateRangeRounder
round in interface DateRangeRounderdateRange - The MutableDateRange to round. Will be changed.
dateRange for the possiblility to chain.public long getMillis()
public boolean getRoundStart()
public boolean getRoundEnd()
public boolean getKeepSameLength()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||