@Override public Temporal apply(Temporal arg1, Temporal arg2, int flags) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } if (arg1 instanceof Time && arg2 instanceof Time) { return Time.max((Time) arg1, (Time) arg2); } else if (arg1 instanceof Duration && arg2 instanceof Duration) { return Duration.max((Duration) arg1, (Duration) arg2); } else { throw new UnsupportedOperationException("MAX not implemented for arg1=" + arg1.getClass() + ", arg2=" + arg2.getClass()); } } },
public Temporal apply(Temporal arg1, Temporal arg2, int flags) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } if (arg1 instanceof Time && arg2 instanceof Time) { return Time.max((Time) arg1, (Time) arg2); } else if (arg1 instanceof Duration && arg2 instanceof Duration) { return Duration.max((Duration) arg1, (Duration) arg2); } else { throw new UnsupportedOperationException("MAX not implemented for arg1=" + arg1.getClass() + ", arg2=" + arg2.getClass()); } } },
public Temporal apply(Temporal arg1, Temporal arg2, int flags) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } if (arg1 instanceof Time && arg2 instanceof Time) { return Time.max((Time) arg1, (Time) arg2); } else if (arg1 instanceof Duration && arg2 instanceof Duration) { return Duration.max((Duration) arg1, (Duration) arg2); } else { throw new UnsupportedOperationException("MAX not implemented for arg1=" + arg1.getClass() + ", arg2=" + arg2.getClass()); } } },
@Override public Temporal apply(Temporal arg1, Temporal arg2, int flags) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } if (arg1 instanceof Time && arg2 instanceof Time) { return Time.max((Time) arg1, (Time) arg2); } else if (arg1 instanceof Duration && arg2 instanceof Duration) { return Duration.max((Duration) arg1, (Duration) arg2); } else { throw new UnsupportedOperationException("MAX not implemented for arg1=" + arg1.getClass() + ", arg2=" + arg2.getClass()); } } },
public Temporal intersect(Temporal t) { if (t instanceof Time) { return new RelativeTime((Time) t, TemporalOp.INTERSECT, this); } else if (t instanceof Range) { Range rt = (Range) t; // Assume begin/end defined (TODO: handle if duration defined) Time b = Time.max(begin, rt.begin); Time e = Time.min(end, rt.end); return new Range(b, e); } else if (t instanceof Duration) { return new InexactTime(null, (Duration) t, this); } return null; }
@Override public Temporal intersect(Temporal t) { if (t instanceof Time) { return new RelativeTime((Time) t, TemporalOp.INTERSECT, this); } else if (t instanceof Range) { Range rt = (Range) t; // Assume begin/end defined (TODO: handle if duration defined) Time b = Time.max(begin, rt.begin); Time e = Time.min(end, rt.end); return new Range(b, e); } else if (t instanceof Duration) { return new InexactTime(null, (Duration) t, this); } return null; }
public Temporal intersect(Temporal t) { if (t instanceof Time) { return new RelativeTime((Time) t, TemporalOp.INTERSECT, this); } else if (t instanceof Range) { Range rt = (Range) t; // Assume begin/end defined (TODO: handle if duration defined) Time b = Time.max(begin, rt.begin); Time e = Time.min(end, rt.end); return new Range(b, e); } else if (t instanceof Duration) { return new InexactTime(null, (Duration) t, this); } return null; }
@Override public Temporal intersect(Temporal t) { if (t instanceof Time) { return new RelativeTime((Time) t, TemporalOp.INTERSECT, this); } else if (t instanceof Range) { Range rt = (Range) t; // Assume begin/end defined (TODO: handle if duration defined) Time b = Time.max(begin, rt.begin); Time e = Time.min(end, rt.end); return new Range(b, e); } else if (t instanceof Duration) { return new InexactTime(null, (Duration) t, this); } return null; }