예제 #1
0
 @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);
 }
예제 #2
0
 @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;
 }
예제 #3
0
 @Override
 public double compareToContinuous(@Nullable final IContinuousGenericBound<Data> otherBound) {
   return getComparator()
       .compareContinuous(this.getValue(), (otherBound != null) ? otherBound.getValue() : null);
 }