@Override public Range getRange(int flags, Duration inputGranularity) { Duration d = getDuration(); if (d != null) { int padType = (flags & RANGE_FLAGS_PAD_MASK);
@Override public Range getRange(int flags, Duration inputGranularity) { Duration d = getDuration(); if (d != null) { int padType = (flags & RANGE_FLAGS_PAD_MASK);
public Range getRange(int flags, Duration inputGranularity) { Duration d = getDuration(); if (d != null) { int padType = (flags & RANGE_FLAGS_PAD_MASK);
public Range getRange(int flags, Duration inputGranularity) { Duration d = getDuration(); if (d != null) { int padType = (flags & RANGE_FLAGS_PAD_MASK);
public static Pair<PartialTime, PartialTime> getCompatible(PartialTime t1, PartialTime t2) { // Incompatible timezones if (t1.dateTimeZone != null && t2.dateTimeZone != null && !t1.dateTimeZone.equals(t2.dateTimeZone)) return null; if (t1.isCompatible(t2)) return Pair.makePair(t1,t2); if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity == null) { if (t1.uncertaintyGranularity.compareTo(t2.getDuration()) > 0) { // Drop the uncertain fields from t1 Duration d = t1.uncertaintyGranularity; PartialTime t1b = t1.reduceGranularityTo(d); if (t1b.isCompatible(t2)) return Pair.makePair(t1b,t2); } } else if (t1.uncertaintyGranularity == null && t2.uncertaintyGranularity != null) { if (t2.uncertaintyGranularity.compareTo(t1.getDuration()) > 0) { // Drop the uncertain fields from t2 Duration d = t2.uncertaintyGranularity; PartialTime t2b = t2.reduceGranularityTo(d); if (t1.isCompatible(t2b)) return Pair.makePair(t1,t2b); } } else if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity != null) { Duration d1 = Duration.max(t1.uncertaintyGranularity, t2.getDuration()); Duration d2 = Duration.max(t2.uncertaintyGranularity, t1.getDuration()); PartialTime t1b = t1.reduceGranularityTo(d1); PartialTime t2b = t2.reduceGranularityTo(d2); if (t1b.isCompatible(t2b)) return Pair.makePair(t1b,t2b); } return null; }
public static Pair<PartialTime, PartialTime> getCompatible(PartialTime t1, PartialTime t2) { // Incompatible timezones if (t1.dateTimeZone != null && t2.dateTimeZone != null && !t1.dateTimeZone.equals(t2.dateTimeZone)) return null; if (t1.isCompatible(t2)) return Pair.makePair(t1,t2); if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity == null) { if (t1.uncertaintyGranularity.compareTo(t2.getDuration()) > 0) { // Drop the uncertain fields from t1 Duration d = t1.uncertaintyGranularity; PartialTime t1b = t1.reduceGranularityTo(d); if (t1b.isCompatible(t2)) return Pair.makePair(t1b,t2); } } else if (t1.uncertaintyGranularity == null && t2.uncertaintyGranularity != null) { if (t2.uncertaintyGranularity.compareTo(t1.getDuration()) > 0) { // Drop the uncertain fields from t2 Duration d = t2.uncertaintyGranularity; PartialTime t2b = t2.reduceGranularityTo(d); if (t1.isCompatible(t2b)) return Pair.makePair(t1,t2b); } } else if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity != null) { Duration d1 = Duration.max(t1.uncertaintyGranularity, t2.getDuration()); Duration d2 = Duration.max(t2.uncertaintyGranularity, t1.getDuration()); PartialTime t1b = t1.reduceGranularityTo(d1); PartialTime t2b = t2.reduceGranularityTo(d2); if (t1b.isCompatible(t2b)) return Pair.makePair(t1b,t2b); } return null; }
public static Pair<PartialTime, PartialTime> getCompatible(PartialTime t1, PartialTime t2) { // Incompatible timezones if (t1.dateTimeZone != null && t2.dateTimeZone != null && !t1.dateTimeZone.equals(t2.dateTimeZone)) return null; if (t1.isCompatible(t2)) return Pair.makePair(t1,t2); if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity == null) { if (t1.uncertaintyGranularity.compareTo(t2.getDuration()) > 0) { // Drop the uncertain fields from t1 Duration d = t1.uncertaintyGranularity; PartialTime t1b = t1.reduceGranularityTo(d); if (t1b.isCompatible(t2)) return Pair.makePair(t1b,t2); } } else if (t1.uncertaintyGranularity == null && t2.uncertaintyGranularity != null) { if (t2.uncertaintyGranularity.compareTo(t1.getDuration()) > 0) { // Drop the uncertain fields from t2 Duration d = t2.uncertaintyGranularity; PartialTime t2b = t2.reduceGranularityTo(d); if (t1.isCompatible(t2b)) return Pair.makePair(t1,t2b); } } else if (t1.uncertaintyGranularity != null && t2.uncertaintyGranularity != null) { Duration d1 = Duration.max(t1.uncertaintyGranularity, t2.getDuration()); Duration d2 = Duration.max(t2.uncertaintyGranularity, t1.getDuration()); PartialTime t1b = t1.reduceGranularityTo(d1); PartialTime t2b = t2.reduceGranularityTo(d2); if (t1b.isCompatible(t2b)) return Pair.makePair(t1b,t2b); } return null; }