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, wait
accepts, aligns, intervalsIterator, roundCeiling, satisfiedBy
intervalsIterable, intervalsIterator, satisfies
public 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()
TimeGrain
public String getPeriodString()
TimeGrain
getPeriodString
in interface TimeGrain
public 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 TimeGrain
dateTime
- The time being roundedpublic org.joda.time.ReadablePeriod getPeriod()
TimeGrain
public String getName()
Granularity
getName
in interface Granularity
getName
in interface TimeGrain
public String getAlignmentDescription()
Granularity
getAlignmentDescription
in interface Granularity
getAlignmentDescription
in interface TimeGrain
public org.joda.time.Duration getEstimatedDuration()
TimeGrain
getEstimatedDuration
in interface TimeGrain
public String getTimeZoneName()
public boolean aligns(org.joda.time.DateTime dateTime)
TimeGrain
public boolean satisfiedBy(TimeGrain grain)
TimeGrain
satisfiedBy
in interface TimeGrain
grain
- 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.