return super.intersect(t);
public Time intersect(Time t) { if (t == null || t == TIME_UNKNOWN) return this; if (base == null) return t; if (t instanceof PartialTime) { Pair<PartialTime,PartialTime> compatible = getCompatible(this, (PartialTime) t); if (compatible == null) { return null; } Partial p = JodaTimeUtils.combine(compatible.first.base, compatible.second.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 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 Temporal intersect(Temporal t) { if (t == null) return this; if (t == TIME_UNKNOWN || t == DURATION_UNKNOWN) return this; if (base == null) return t; if (t instanceof Time) { return intersect((Time) t); } else if (t instanceof Range) { return t.intersect(this); } else if (t instanceof Duration) { return new RelativeTime(this, TemporalOp.INTERSECT, t); } return null; }
return super.intersect(t);