private static int compareUpperLower(final OWLRealInterval a, final OWLRealInterval b) { int ul; if (!a.boundUpper()) ul = 1; else if (!b.boundLower()) ul = 1; else ul = OWLRealUtils.compare(a.getUpper(), b.getLower()); return ul; }
private static int compareUpperLower(final OWLRealInterval a, final OWLRealInterval b) { int ul; if (!a.boundUpper()) ul = 1; else if (!b.boundLower()) ul = 1; else ul = OWLRealUtils.compare(a.getUpper(), b.getLower()); return ul; }
/** * Get the subinterval greater than n * * @param n * @return a new interval, formed by intersecting this interval with (n,+inf) or <code>null</code> if that intersection is empty */ public OWLRealInterval greater(final Number n) { if (boundLower() && OWLRealUtils.compare(n, getLower()) < 0) return this; else if (boundUpper() && OWLRealUtils.compare(n, getUpper()) >= 0) return null; return new OWLRealInterval(n, getUpper(), false, inclusiveUpper(), getType()); }
/** * Get the subinterval greater than n * * @param n * @return a new interval, formed by intersecting this interval with (n,+inf) or <code>null</code> if that intersection is empty */ public OWLRealInterval greater(final Number n) { if (boundLower() && OWLRealUtils.compare(n, getLower()) < 0) return this; else if (boundUpper() && OWLRealUtils.compare(n, getUpper()) >= 0) return null; return new OWLRealInterval(n, getUpper(), false, inclusiveUpper(), getType()); }
@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}"); }
private static int compareUpperUpper(final OWLRealInterval a, final OWLRealInterval b) { int uu; if (!a.boundUpper()) { if (!b.boundUpper()) uu = 0; else uu = 1; } else if (!b.boundUpper()) uu = -1; else { uu = OWLRealUtils.compare(a.getUpper(), b.getUpper()); if (uu == 0) if (a.inclusiveUpper()) { if (!b.inclusiveUpper()) uu = 1; } else if (b.inclusiveUpper()) uu = -1; } return uu; }
private static int compareUpperUpper(final OWLRealInterval a, final OWLRealInterval b) { int uu; if (!a.boundUpper()) { if (!b.boundUpper()) uu = 0; else uu = 1; } else if (!b.boundUpper()) uu = -1; else { uu = OWLRealUtils.compare(a.getUpper(), b.getUpper()); if (uu == 0) if (a.inclusiveUpper()) { if (!b.inclusiveUpper()) uu = 1; } else if (b.inclusiveUpper()) uu = -1; } return uu; }
during = null; else during = new OWLRealInterval(other.getLower(), other.getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = new OWLRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper(), t1); break; during = null; else during = new OWLRealInterval(getLower(), getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = null; break; during = null; else during = new OWLRealInterval(other.getLower(), getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = null; break; before = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), false, t1); during = null; after = null; before = null; during = null; after = new OWLRealInterval(getLower(), getUpper(), false, inclusiveUpper(), t1); break; during = null; else
during = null; else during = new OWLRealInterval(other.getLower(), other.getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = new OWLRealInterval(other.getUpper(), getUpper(), !other.inclusiveUpper(), inclusiveUpper(), t1); break; during = null; else during = new OWLRealInterval(getLower(), getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = null; break; during = null; else during = new OWLRealInterval(other.getLower(), getUpper(), false, false, LineType.INTEGER_EXCLUDED.equals(t2) ? LineType.INTEGER_ONLY : LineType.INTEGER_EXCLUDED); after = null; break; before = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), false, t1); during = null; after = null; before = null; during = null; after = new OWLRealInterval(getLower(), getUpper(), false, inclusiveUpper(), t1); break; during = null; else
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; 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; during = other; else during = new OWLRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; during = this; else during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; return Collections.singletonList(new OWLRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper(), t1));
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; 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; during = other; else during = new OWLRealInterval(other.getLower(), getUpper(), other.inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; during = this; else during = new OWLRealInterval(getLower(), getUpper(), inclusiveLower(), inclusiveUpper(), LineType.CONTINUOUS); after = null; break; return Collections.singletonList(new OWLRealInterval(getLower(), other.getUpper(), inclusiveLower(), other.inclusiveUpper(), t1));
/** * 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()); }
upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); break; upper = getUpper(); inclusiveUpper = inclusiveUpper(); break; upper = getUpper(); inclusiveUpper = inclusiveUpper(); break; lower = that.getLower(); inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); break; lower = getLower(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); break; lower = getLower(); inclusiveLower = inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); break;
upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); break; upper = getUpper(); inclusiveUpper = inclusiveUpper(); break; upper = getUpper(); inclusiveUpper = inclusiveUpper(); break; lower = that.getLower(); inclusiveLower = that.inclusiveLower(); upper = that.getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); break; lower = getLower(); inclusiveLower = inclusiveLower(); upper = getUpper(); inclusiveUpper = inclusiveUpper() && that.inclusiveUpper(); break; lower = getLower(); inclusiveLower = inclusiveLower(); upper = that.getUpper(); inclusiveUpper = that.inclusiveUpper(); break;
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; }