@Override public Temporal apply(Object... args) { if (args.length == 2) { if (args[0] instanceof TimeUnit && args[1] instanceof Number) { return apply((TimeUnit) args[0], ((Number) args[1]).intValue()); } else if (args[0] instanceof StandardTemporalType && args[1] instanceof Number) { return ((StandardTemporalType) args[0]).createTemporal(((Number) args[1]).intValue()); } else if (args[0] instanceof Temporal && args[1] instanceof Number) { return new OrdinalTime((Temporal) args[0], ((Number) args[1]).intValue()); } } throw new UnsupportedOperationException("apply(Object...) not implemented for TemporalOp " + this); } },
return tlt.getPeriod();
return tlt.getPeriod();
return tlt.getPeriod();
public Duration getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } if (base == null) { return null; } DateTimeFieldType mostGeneral = JodaTimeUtils.getMostGeneral(base); DurationFieldType df = mostGeneral.getRangeDurationType(); // if (df == null) { // df = mostGeneral.getDurationType(); // } if (df != null) { try { return new DurationWithFields(new Period().withField(df, 1)); } catch (Exception ex) { // TODO: Do something intelligent here } } return null; }
@Override public Duration getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } if (base == null) { return null; } DateTimeFieldType mostGeneral = JodaTimeUtils.getMostGeneral(base); DurationFieldType df = mostGeneral.getRangeDurationType(); // if (df == null) { // df = mostGeneral.getDurationType(); // } if (df != null) { try { return new DurationWithFields(new Period().withField(df, 1)); } catch (Exception ex) { // TODO: Do something intelligent here } } return null; }
@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 Temporal apply(Object... args) { if (args.length == 2) { if (args[0] instanceof TimeUnit && args[1] instanceof Number) { return apply((TimeUnit) args[0], ((Number) args[1]).intValue()); } else if (args[0] instanceof StandardTemporalType && args[1] instanceof Number) { return ((StandardTemporalType) args[0]).createTemporal(((Number) args[1]).intValue()); } else if (args[0] instanceof Temporal && args[1] instanceof Number) { return new OrdinalTime((Temporal) args[0], ((Number) args[1]).intValue()); } } throw new UnsupportedOperationException("apply(Object...) not implemented for TemporalOp " + this); } },
@Override public Temporal apply(Object... args) { if (args.length == 2) { if (args[0] instanceof TimeUnit && args[1] instanceof Number) { return apply((TimeUnit) args[0], ((Number) args[1]).intValue()); } else if (args[0] instanceof StandardTemporalType && args[1] instanceof Number) { return ((StandardTemporalType) args[0]).createTemporal(((Number) args[1]).intValue()); } else if (args[0] instanceof Temporal && args[1] instanceof Number) { return new OrdinalTime((Temporal) args[0], ((Number) args[1]).intValue()); } } throw new UnsupportedOperationException("apply(Object...) not implemented for TemporalOp " + this); } },
public Duration getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } return this; }
public Duration getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } return null; }
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 getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } return this; }
public Duration getPeriod() { /* TimeLabel tl = getTimeLabel(); if (tl != null) { return tl.getPeriod(); } */ StandardTemporalType tlt = getStandardTemporalType(); if (tlt != null) { return tlt.getPeriod(); } return null; }
public TimexType getTimexType() { if (getStandardTemporalType() != null) { return getStandardTemporalType().getTimexType(); } return (hasTime()) ? TimexType.TIME : TimexType.DATE; }
public Temporal createTemporal(int n) { Temporal t = _createTemporal(n); if (t != null) { t.standardTemporalType = this; } return t; }
@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)); }