return this; } else { return new CompositePartialTime(this, p, poy, dow, tod);
Range r = tod.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, dow, null); return getIntersectedRange(cpt, r, d); } else { Range r = dow.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, dow, null); return getIntersectedRange(cpt, r, d); } else { Range r = poy.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, null, null); return getIntersectedRange(cpt, r, d); } else {
public Time intersect(Time t) { if (t == null || t == TIME_UNKNOWN) return this; if (base == null) return t; if (t instanceof PartialTime) { if (!isCompatible((PartialTime) t)) { return null; } Partial p = JodaTimeUtils.combine(this.base, ((PartialTime) t).base); if (t instanceof CompositePartialTime) { CompositePartialTime cpt = (CompositePartialTime) t; Time ntod = Time.intersect(tod, cpt.tod); Time ndow = Time.intersect(dow, cpt.dow); Time npoy = Time.intersect(poy, cpt.poy); if (ntod == null && (tod != null || cpt.tod != null)) return null; if (ndow == null && (dow != null || cpt.dow != null)) return null; if (npoy == null && (poy != null || cpt.poy != null)) return null; return new CompositePartialTime(this, p, npoy, ndow, ntod); } else { return new CompositePartialTime(this, p, poy, dow, tod); } } else { return super.intersect(t); } }
public static CompositePartialTime makeComposite(PartialTime pt, Time t) { CompositePartialTime cp = null; TimeLabelType tlt = t.getTimeLabelType(); if (tlt != null) { switch (tlt) { case TIME_OF_DAY: cp = new CompositePartialTime(pt, null, null, t); break; case PART_OF_YEAR: case QUARTER_OF_YEAR: case SEASON_OF_YEAR: cp = new CompositePartialTime(pt, t, null, null); break; case DAYS_OF_WEEK: cp = new CompositePartialTime(pt, null, t, null); break; } } return cp; }
public static CompositePartialTime makeComposite(PartialTime pt, Time t) { CompositePartialTime cp = null; StandardTemporalType tlt = t.getStandardTemporalType(); if (tlt != null) { switch (tlt) { case TIME_OF_DAY: cp = new CompositePartialTime(pt, null, null, t); break; case PART_OF_YEAR: case QUARTER_OF_YEAR: case SEASON_OF_YEAR: cp = new CompositePartialTime(pt, t, null, null); break; case DAYS_OF_WEEK: cp = new CompositePartialTime(pt, null, t, null); break; } } return cp; }
public static CompositePartialTime makeComposite(PartialTime pt, Time t) { CompositePartialTime cp = null; StandardTemporalType tlt = t.getStandardTemporalType(); if (tlt != null) { switch (tlt) { case TIME_OF_DAY: cp = new CompositePartialTime(pt, null, null, t); break; case PART_OF_YEAR: case QUARTER_OF_YEAR: case SEASON_OF_YEAR: cp = new CompositePartialTime(pt, t, null, null); break; case DAYS_OF_WEEK: cp = new CompositePartialTime(pt, null, t, null); break; } } return cp; }
protected PartialTime addSupported(Period p, int scalar) { return new CompositePartialTime(this, base.withPeriodAdded(p, 1), poy, dow, tod); }
protected PartialTime addSupported(Period p, int scalar) { return new CompositePartialTime(this, base.withPeriodAdded(p, 1), poy, dow, tod); }
protected PartialTime addUnsupported(Period p, int scalar) { return new CompositePartialTime(this, JodaTimeUtils.addForce(base, p, scalar), poy, dow, tod); }
protected PartialTime addUnsupported(Period p, int scalar) { return new CompositePartialTime(this, JodaTimeUtils.addForce(base, p, scalar), poy, dow, tod); }
@Override protected PartialTime addSupported(Period p, int scalar) { return new CompositePartialTime(this, base.withPeriodAdded(p, 1), poy, dow, tod); }
@Override protected PartialTime addUnsupported(Period p, int scalar) { return new CompositePartialTime(this, JodaTimeUtils.addForce(base, p, scalar), poy, dow, tod); }
@Override public PartialTime reduceGranularityTo(Duration granularity) { Partial p = JodaTimeUtils.discardMoreSpecificFields( base, JodaTimeUtils.getMostSpecific(granularity.getJodaTimePeriod()) ); return new CompositePartialTime(this, p, poy.reduceGranularityTo(granularity), dow.reduceGranularityTo(granularity), tod.reduceGranularityTo(granularity)); }
public PartialTime reduceGranularityTo(Duration granularity) { Partial p = JodaTimeUtils.discardMoreSpecificFields( base, JodaTimeUtils.getMostSpecific(granularity.getJodaTimePeriod()) ); return new CompositePartialTime(this, p, poy.reduceGranularityTo(granularity), dow.reduceGranularityTo(granularity), tod.reduceGranularityTo(granularity)); }
if (npoy == null && (poy != null || cpt.poy != null)) return null; return new CompositePartialTime(this, p, npoy, ndow, ntod); } else { return new CompositePartialTime(this, p, poy, dow, tod);
Range r = tod.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, dow, null); return getIntersectedRange(cpt, r, d); } else { Range r = dow.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, dow, null); return getIntersectedRange(cpt, r, d); } else { Range r = poy.getRange(flags, granularity); if (r != null) { CompositePartialTime cpt = new CompositePartialTime(this, poy, null, null); return getIntersectedRange(cpt, r, d); } else {
public static CompositePartialTime makeComposite(PartialTime pt, Time t) { CompositePartialTime cp = null; StandardTemporalType tlt = t.getStandardTemporalType(); if (tlt != null) { switch (tlt) { case TIME_OF_DAY: cp = new CompositePartialTime(pt, null, null, t); break; case PART_OF_YEAR: case QUARTER_OF_YEAR: case SEASON_OF_YEAR: cp = new CompositePartialTime(pt, t, null, null); break; case DAYS_OF_WEEK: cp = new CompositePartialTime(pt, null, t, null); break; } } return cp; }
@Override protected PartialTime addSupported(Period p, int scalar) { return new CompositePartialTime(this, base.withPeriodAdded(p, 1), poy, dow, tod); }
@Override protected PartialTime addUnsupported(Period p, int scalar) { return new CompositePartialTime(this, JodaTimeUtils.addForce(base, p, scalar), poy, dow, tod); }
@Override public PartialTime reduceGranularityTo(Duration granularity) { Partial p = JodaTimeUtils.discardMoreSpecificFields( base, JodaTimeUtils.getMostSpecific(granularity.getJodaTimePeriod()) ); return new CompositePartialTime(this, p, poy.reduceGranularityTo(granularity), dow.reduceGranularityTo(granularity), tod.reduceGranularityTo(granularity)); }