code: @Override
      public ValueComparator compare(Value o) {
          if (o == null) {
              return ValueComparator.NOT_EQUAL_TO;
          }
          switch (o.getType()) {
              case ORDINALVALUE:
                  OrdinalValue other = (OrdinalValue) o;
                  if (val == null || other.val == null) {
                      return ValueComparator.UNKNOWN;
                  }
  
                  int c = this.index - other.index;
                  if (c == 0) {
                      return ValueComparator.EQUAL_TO;
                  } else if (c > 0) {
                      return ValueComparator.GREATER_THAN;
                  } else {
                      return ValueComparator.LESS_THAN;
                  }
              case VALUELIST:
                  ValueList<?> vl = (ValueList<?>) o;
                  return equals(vl) ? ValueComparator.EQUAL_TO 
                          : ValueComparator.NOT_EQUAL_TO;
              default:
                  return ValueComparator.NOT_EQUAL_TO;
          }
      }
docs: Compares this value and another according to the defined order, or
  checks this number value for membership in a value list.
  
  @param o a {@link Value}.
  @return If the provided value is an {@link OrdinalValue}, returns
  {@link ValueComparator#GREATER_THAN},
  {@link ValueComparator#LESS_THAN} or {@link ValueComparator#EQUAL_TO}
  depending on whether this value is numerically greater than,
  less than or equal to the value provided as argument. If the provided
  value is a {@link ValueList}, returns
  {@link ValueComparator#IN} if this object is a member of the list, or
  {@link ValueComparator#NOT_IN} if not. Otherwise, returns
  {@link ValueComparator#UNKNOWN}.