public class ZonedTimeGrain extends Object implements TimeGrain
ZonelessTimeGrain is that alignment testing and
rounding on a ZonedTimeGrain will be considered with respect to the ZonedTimeGrain's buckets rather than using the
time zone on the date time supplied.| Constructor and Description |
|---|
ZonedTimeGrain(ZonelessTimeGrain baseTimeGrain,
org.joda.time.DateTimeZone timeZone)
Create a Zoned Time grain wrapping a
ZonelessTimeGrain and a joda
DateTimeZone. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
aligns(org.joda.time.DateTime dateTime)
Determines if this dateTime falls on a time grain boundary.
|
boolean |
equals(Object that) |
String |
getAlignmentDescription()
Get description of correct alignment of a granularity, e.g.
|
ZonelessTimeGrain |
getBaseTimeGrain() |
org.joda.time.Duration |
getEstimatedDuration()
Estimated duration gives a rough millisecond length of the TimeGrain usable for comparison.
|
String |
getName()
Get the name of the granularity.
|
org.joda.time.ReadablePeriod |
getPeriod()
Get the Period of the TimeGrain.
|
String |
getPeriodString()
Period string to use when serializing.
|
org.joda.time.DateTimeZone |
getTimeZone() |
String |
getTimeZoneName() |
String |
getType()
Type of Granularity to use when serializing.
|
int |
hashCode() |
org.joda.time.DateTime |
roundFloor(org.joda.time.DateTime dateTime)
Use the inner grain's round function to round a
DateTime, but use the bucketing of this
grain's timezone rather than the one from the date time itself. |
boolean |
satisfiedBy(TimeGrain grain)
True if the argument grain can be used to build this grain.
|
String |
toString() |
ZonedTimeGrain |
withZone(org.joda.time.DateTimeZone dateTimeZone)
Create a ZonedTimeGrain with the same base grain and a different time zone.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaccepts, aligns, intervalsIterator, roundCeiling, satisfiedByintervalsIterable, intervalsIterator, satisfiespublic ZonedTimeGrain(@NotNull
ZonelessTimeGrain baseTimeGrain,
@NotNull
org.joda.time.DateTimeZone timeZone)
ZonelessTimeGrain and a joda
DateTimeZone.baseTimeGrain - the unzoned time grain to decoratetimeZone - A time zone to apply to this time grainpublic String getType()
TimeGrainpublic String getPeriodString()
TimeGraingetPeriodString in interface TimeGrainpublic org.joda.time.DateTime roundFloor(org.joda.time.DateTime dateTime)
DateTime, but use the bucketing of this
grain's timezone rather than the one from the date time itself.roundFloor in interface TimeGraindateTime - The time being roundedpublic org.joda.time.ReadablePeriod getPeriod()
TimeGrainpublic String getName()
GranularitygetName in interface GranularitygetName in interface TimeGrainpublic String getAlignmentDescription()
GranularitygetAlignmentDescription in interface GranularitygetAlignmentDescription in interface TimeGrainpublic org.joda.time.Duration getEstimatedDuration()
TimeGraingetEstimatedDuration in interface TimeGrainpublic String getTimeZoneName()
public boolean aligns(org.joda.time.DateTime dateTime)
TimeGrainpublic boolean satisfiedBy(TimeGrain grain)
TimeGrainsatisfiedBy in interface TimeGraingrain - The grain being testedpublic ZonelessTimeGrain getBaseTimeGrain()
public org.joda.time.DateTimeZone getTimeZone()
public ZonedTimeGrain withZone(org.joda.time.DateTimeZone dateTimeZone)
dateTimeZone - The time zone to associate with the resulting zone time grainpublic String toString()
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.