Exemplo n.º 1
0
 @Override
 public int compareTo(BoundValue o) {
   if (!comparator.equals(o.comparator)) {
     throw new ISE("WTF?! Comparator mismatch?!");
   }
   return comparator.compare(value, o.value);
 }
Exemplo n.º 2
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    BoundValue that = (BoundValue) o;

    if (value != null ? !value.equals(that.value) : that.value != null) {
      return false;
    }
    return comparator != null ? comparator.equals(that.comparator) : that.comparator == null;
  }
Exemplo n.º 3
0
 @Override
 public int hashCode() {
   int result = value != null ? value.hashCode() : 0;
   result = 31 * result + (comparator != null ? comparator.hashCode() : 0);
   return result;
 }