@Override public Duration getGranularity() { Period res = new Period(); res = res.withField(JodaTimeUtils.getMostSpecific(getJodaTimePeriod()), 1); return Duration.getDuration(res); }
@Override public Temporal resolve(Time t, int flags) { if (t == null) return this; // No resolving to be done? if (base instanceof PartialTime) { PartialTime pt = (PartialTime) base.resolve(t,flags); List<Temporal> list = pt.toList(); if (list != null && list.size() >= n) { return list.get(n-1); } } else if (base instanceof Duration) { Duration d = ((Duration) base).multiplyBy(n-1); Time temp = t.getRange().begin(); return temp.offset(d,0).reduceGranularityTo(d.getDuration()); } return this; }
@Override public Duration getGranularity() { Period res = new Period(); res = res.withField(JodaTimeUtils.getMostSpecific(getJodaTimePeriod()), 1); return Duration.getDuration(res); }
@Override public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } Duration bd = (base != null) ? Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)) : null; if (tod != null) { Duration d = tod.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (dow != null) { Duration d = dow.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (poy != null) { Duration d = poy.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } return bd; }
public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } Duration bd = (base != null) ? Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)) : null; if (tod != null) { Duration d = tod.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (dow != null) { Duration d = dow.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (poy != null) { Duration d = poy.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } return bd; }
public Duration getDuration() { TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } TimeLabelType tlt = getTimeLabelType(); if (tlt != null) { return tlt.getDuration(); } Duration bd = (base != null) ? Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)) : null; if (tod != null) { Duration d = tod.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (dow != null) { Duration d = dow.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (poy != null) { Duration d = poy.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } return bd; }
@Override public Temporal resolve(Time t, int flags) { if (t == null) return this; // No resolving to be done? if (base instanceof PartialTime) { PartialTime pt = (PartialTime) base.resolve(t,flags); List<Temporal> list = pt.toList(); if (list != null && list.size() >= n) { return list.get(n-1); } } else if (base instanceof Duration) { Duration d = ((Duration) base).multiplyBy(n-1); Time temp = t.getRange().begin(); return temp.offset(d,0).reduceGranularityTo(d.getDuration()); } return this; }
public Temporal resolve(Time t, int flags) { if (t == null) return this; // No resolving to be done? if (base instanceof PartialTime) { PartialTime pt = (PartialTime) base.resolve(t,flags); List<Temporal> list = pt.toList(); if (list != null && list.size() >= n) { return list.get(n-1); } } else if (base instanceof Duration) { Duration d = ((Duration) base).multiplyBy(n-1); Time temp = t.getRange().begin(); return temp.offset(d,0).reduceGranularityTo(d.getDuration()); } return this; }
public Duration getDuration() { TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } TimeLabelType tlt = getTimeLabelType(); if (tlt != null) { return tlt.getDuration(); } return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)); }
public Duration getGranularity() { StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getGranularity(); } Partial p = this.getJodaTimePartial(); return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(p)); }
@Override public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)); }
@Override public Duration getGranularity() { StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getGranularity(); } Partial p = this.getJodaTimePartial(); return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(p)); }
public Duration getGranularity() { Period res = new Period(); res = res.withField(JodaTimeUtils.getMostSpecific(getJodaTimePeriod()), 1); return Duration.getDuration(res); }
public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)); }
@Override public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } Duration bd = (base != null) ? Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)) : null; if (tod != null) { Duration d = tod.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (dow != null) { Duration d = dow.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } if (poy != null) { Duration d = poy.getDuration(); return (bd.compareTo(d) < 0) ? bd : d; } return bd; }
@Override public Duration getDuration() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getDuration(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getDuration(); } return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(base)); }
@Override public Duration getGranularity() { StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getGranularity(); } Partial p = this.getJodaTimePartial(); return Duration.getDuration(JodaTimeUtils.getJodaTimePeriod(p)); }