private static int compareLowerLower(final ContinuousRealInterval a, final ContinuousRealInterval other) { int ll; if (!a.boundLower()) { if (!other.boundLower()) ll = 0; else ll = -1; } else if (!other.boundLower()) ll = 1; else { ll = OWLRealUtils.compare(a.getLower(), other.getLower()); if (ll == 0) if (a.inclusiveLower()) { if (!other.inclusiveLower()) ll = -1; } else if (other.inclusiveLower()) ll = 1; } return ll; }
private static int compareLowerLower(final ContinuousRealInterval a, final ContinuousRealInterval other) { int ll; if (!a.boundLower()) { if (!other.boundLower()) ll = 0; else ll = -1; } else if (!other.boundLower()) ll = 1; else { ll = OWLRealUtils.compare(a.getLower(), other.getLower()); if (ll == 0) if (a.inclusiveLower()) { if (!other.inclusiveLower()) ll = -1; } else if (other.inclusiveLower()) ll = 1; } return ll; }
@Override public String toString() { return format("%s%s,%s%s", inclusiveLower() ? "[" : "(", boundLower() ? getLower() : "-Inf", boundUpper() ? getUpper() : "+Inf", inclusiveUpper() ? "]" : ")"); }
@Override public String toString() { return format("%s%s,%s%s", inclusiveLower() ? "[" : "(", boundLower() ? getLower() : "-Inf", boundUpper() ? getUpper() : "+Inf", inclusiveUpper() ? "]" : ")"); }
public List<ContinuousRealInterval> union(final ContinuousRealInterval other) { switch (compare(other)) { case CONTAINS: case EQUALS: case FINISHED_BY: case STARTED_BY: return Collections.singletonList(this); case DURING: case FINISHES: case STARTS: return Collections.singletonList(other); case MEETS: return Collections.singletonList(new ContinuousRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper())); case MET_BY: return Collections.singletonList(new ContinuousRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper())); case OVERLAPPED_BY: return Collections.singletonList(new ContinuousRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper())); case OVERLAPS: return Collections.singletonList(new ContinuousRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper())); case PRECEDED_BY: case PRECEDES: return Arrays.asList(this, other); default: throw new IllegalStateException(); } }
public List<ContinuousRealInterval> union(final ContinuousRealInterval other) { switch (compare(other)) { case CONTAINS: case EQUALS: case FINISHED_BY: case STARTED_BY: return Collections.singletonList(this); case DURING: case FINISHES: case STARTS: return Collections.singletonList(other); case MEETS: return Collections.singletonList(new ContinuousRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper())); case MET_BY: return Collections.singletonList(new ContinuousRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper())); case OVERLAPPED_BY: return Collections.singletonList(new ContinuousRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper())); case OVERLAPS: return Collections.singletonList(new ContinuousRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper())); case PRECEDED_BY: case PRECEDES: return Arrays.asList(this, other); default: throw new IllegalStateException(); } }
if (b.inclusiveLower()) return IntervalRelations.OVERLAPS; else if (b.inclusiveLower()) return IntervalRelations.MEETS; else if (a.inclusiveLower()) return IntervalRelations.OVERLAPPED_BY; else if (a.inclusiveLower()) return IntervalRelations.MET_BY; else
if (b.inclusiveLower()) return IntervalRelations.OVERLAPS; else if (b.inclusiveLower()) return IntervalRelations.MEETS; else if (a.inclusiveLower()) return IntervalRelations.OVERLAPPED_BY; else if (a.inclusiveLower()) return IntervalRelations.MET_BY; else
before = new ContinuousRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower()); after = new ContinuousRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper()); break; before = new ContinuousRealInterval(getLower(), getUpper(), inclusiveLower(), false); after = null; break; before = new ContinuousRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower()); after = null; break;
before = new ContinuousRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower()); after = new ContinuousRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper()); break; before = new ContinuousRealInterval(getLower(), getUpper(), inclusiveLower(), false); after = null; break; before = new ContinuousRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower()); after = null; break;
private static ContinuousRealInterval zoneShrink(final ContinuousRealInterval i) { final Number lower = i.boundLower() ? OWLRealUtils.sum(i.getLower(), TZ_SHIFT) : null; final Number upper = i.boundUpper() ? OWLRealUtils.sum(i.getUpper(), -TZ_SHIFT) : null; if (lower != null && upper != null) { final int cmp = OWLRealUtils.compare(lower, upper); if (cmp > 0) return null; else if (cmp == 0) if (!i.inclusiveLower() && !i.inclusiveUpper()) return null; else return new ContinuousRealInterval(lower); } return new ContinuousRealInterval(lower, upper, i.inclusiveLower(), i.inclusiveUpper()); }
private static ContinuousRealInterval zoneShrink(final ContinuousRealInterval i) { final Number lower = i.boundLower() ? OWLRealUtils.sum(i.getLower(), TZ_SHIFT) : null; final Number upper = i.boundUpper() ? OWLRealUtils.sum(i.getUpper(), -TZ_SHIFT) : null; if (lower != null && upper != null) { final int cmp = OWLRealUtils.compare(lower, upper); if (cmp > 0) return null; else if (cmp == 0) if (!i.inclusiveLower() && !i.inclusiveUpper()) return null; else return new ContinuousRealInterval(lower); } return new ContinuousRealInterval(lower, upper, i.inclusiveLower(), i.inclusiveUpper()); }
inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper(); inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); inclusiveLower = that.inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper();
inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper(); inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); inclusiveLower = inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); inclusiveLower = that.inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper();
/** * Get the subinterval less than n * * @param n * @return a new interval, formed by intersecting this interval with (-inf,n) or <code>null</code> if that intersection is empty */ public ContinuousRealInterval less(final Number n) { if (boundUpper() && OWLRealUtils.compare(n, getUpper()) > 0) return this; else if (boundLower() && OWLRealUtils.compare(n, getLower()) <= 0) return null; return new ContinuousRealInterval(getLower(), n, inclusiveLower(), false); }
/** * Get the subinterval less than n * * @param n * @return a new interval, formed by intersecting this interval with (-inf,n) or <code>null</code> if that intersection is empty */ public ContinuousRealInterval less(final Number n) { if (boundUpper() && OWLRealUtils.compare(n, getUpper()) > 0) return this; else if (boundLower() && OWLRealUtils.compare(n, getLower()) <= 0) return null; return new ContinuousRealInterval(getLower(), n, inclusiveLower(), false); }
public boolean contains(final Number n) { int comp; if (boundLower()) { comp = OWLRealUtils.compare(getLower(), n); if (comp > 0) return false; if (comp == 0 && !inclusiveLower()) return false; } if (boundUpper()) { comp = OWLRealUtils.compare(getUpper(), n); if (comp < 0) return false; if (comp == 0 && !inclusiveUpper()) return false; } return true; }
public boolean contains(final Number n) { int comp; if (boundLower()) { comp = OWLRealUtils.compare(getLower(), n); if (comp > 0) return false; if (comp == 0 && !inclusiveLower()) return false; } if (boundUpper()) { comp = OWLRealUtils.compare(getUpper(), n); if (comp < 0) return false; if (comp == 0 && !inclusiveUpper()) return false; } return true; }
if (OWLRealUtils.isInteger(cl)) if (continuousRestriction.inclusiveLower()) lower = cl; else
if (OWLRealUtils.isInteger(cl)) if (continuousRestriction.inclusiveLower()) lower = cl; else