@Override public boolean isSucceeding(final IContinuousGenericBound<Data> bound) { if (isInfinity() || bound.isInfinity()) return false; final Data value = bound.getValue(); if (value != null) return (isLowerBound() && !bound.isLowerBound() && isClosed() != bound.isClosed() && value.equals(getValue())); return (isLowerBound() && !bound.isLowerBound() && isClosed() != bound.isClosed() && getValue() == null); }
@Override public int compareTo(@Nullable final IContinuousGenericBound<Data> o) { final int compare = getComparator().compare(_value, (o != null) ? o.getValue() : null); if (o == null) return 1; if (compare == 0) { // (!isClosed() && !isLowerBound()) --> X- // (!isClosed() && isLowerBound()) --> X+ // (isClosed() && !isLowerBound()) --> X // (isClosed() && isLowerBound()) --> X if (isClosed() == o.isClosed() && isLowerBound() == o.isLowerBound()) // this == o return 0; if (!o.isClosed() && o.isLowerBound()) // o --> X+ return -1; if (!o.isClosed() && !o.isLowerBound()) // o --> X- return 1; if (!isClosed() && isLowerBound()) // this --> X+ return 1; if (!isClosed() && !isLowerBound()) // this --> X- return -1; return 0; } return compare; }