private static int compareLowerLower(final OWLRealInterval a, final OWLRealInterval 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 OWLRealInterval a, final OWLRealInterval 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; }
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
@Override public String toString() { return format("%s%s,%s%s%s", inclusiveLower() ? "[" : "(", boundLower() ? getLower() : "-Inf", boundUpper() ? getUpper() : "+Inf", inclusiveUpper() ? "]" : ")", _type.equals(LineType.CONTINUOUS) ? "" : _type.equals(LineType.INTEGER_ONLY) ? "{int}" : "{noint}"); }
@Override public String toString() { return format("%s%s,%s%s%s", inclusiveLower() ? "[" : "(", boundLower() ? getLower() : "-Inf", boundUpper() ? getUpper() : "+Inf", inclusiveUpper() ? "]" : ")", _type.equals(LineType.CONTINUOUS) ? "" : _type.equals(LineType.INTEGER_ONLY) ? "{int}" : "{noint}"); }
before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (LineType.CONTINUOUS.equals(t2)) during = other; else during = new OWLRealInterval(other.getLower(), other.getUpper(), other.inclusiveLower(), other.inclusiveUpper(), LineType.CONTINUOUS); after = new OWLRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper(), t1); break; before = new OWLRealInterval(other.getLower(), getLower(), other.inclusiveLower(), !inclusiveLower(), t2); if (LineType.CONTINUOUS.equals(t1)) during = this; else during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = new OWLRealInterval(getUpper(), other.getUpper(), !inclusiveUpper(), other.inclusiveUpper(), t2); break; during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (LineType.CONTINUOUS.equals(t2)) during = other; else during = new OWLRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; before = new OWLRealInterval(other.getLower(), getLower(), other.inclusiveLower(), !inclusiveLower(), t2);
before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (LineType.CONTINUOUS.equals(t2)) during = other; else during = new OWLRealInterval(other.getLower(), other.getUpper(), other.inclusiveLower(), other.inclusiveUpper(), LineType.CONTINUOUS); after = new OWLRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper(), t1); break; before = new OWLRealInterval(other.getLower(), getLower(), other.inclusiveLower(), !inclusiveLower(), t2); if (LineType.CONTINUOUS.equals(t1)) during = this; else during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = new OWLRealInterval(getUpper(), other.getUpper(), !inclusiveUpper(), other.inclusiveUpper(), t2); break; during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (LineType.CONTINUOUS.equals(t2)) during = other; else during = new OWLRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; before = new OWLRealInterval(other.getLower(), getLower(), other.inclusiveLower(), !inclusiveLower(), t2);
/** * 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 OWLRealInterval 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 OWLRealInterval(getLower(), n, inclusiveLower(), false, getType()); }
/** * 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 OWLRealInterval 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 OWLRealInterval(getLower(), n, inclusiveLower(), false, getType()); }
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();
before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null; before = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), false, t1); during = null; after = null; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null;
before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null; before = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), false, t1); during = null; after = null; before = new OWLRealInterval(getLower(), other.getLower(), inclusiveLower(), !other.inclusiveLower(), t1); if (t1.equals(t2) || LineType.CONTINUOUS.equals(t2)) during = null;
public boolean contains(final Number n) { if (_type.equals(LineType.INTEGER_ONLY)) { if (!isInteger(n)) return false; } else if (_type.equals(LineType.INTEGER_EXCLUDED)) if (isInteger(n)) return false; 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) { if (_type.equals(LineType.INTEGER_ONLY)) { if (!isInteger(n)) return false; } else if (_type.equals(LineType.INTEGER_EXCLUDED)) if (isInteger(n)) return false; 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; }