Compares UnicodeSets, in three different ways.
@see java.lang.Comparable#compareTo(java.lang.Object)
170647
public int compareTo(UnicodeSet o, ComparisonStyle style) {
        if (style != ComparisonStyle.LEXICOGRAPHIC) {
            int diff = size() - o.size();
            if (diff != 0) {
                return (diff < 0) == (style == ComparisonStyle.SHORTER_FIRST) ? -1 : 1;
            }
        }
        int result;
        for (int i = 0; ; ++i) {
            if (0 != (result = list[i] - o.list[i])) {
                // if either list ran out, compare to the last string
                if (list[i] == HIGH) {
                    if (strings.isEmpty()) return 1;
                    String item = strings.first();
                    return compare(item, o.list[i]);
                }
                if (o.list[i] == HIGH) {
                    if (o.strings.isEmpty()) return -1;
                    String item = o.strings.first();
                    int compareResult = compare(item, list[i]);
                    return compareResult > 0 ? -1 : compareResult < 0 ? 1 : 0; // Reverse the order.
                }
                // otherwise return the result if even index, or the reversal if not
                return (i & 1) == 0 ? result : -result;
            }
            if (list[i] == HIGH) {
                break;
            }
        }
        return compare(strings, o.strings);
    }
877360
public static ImmutableSet<UnicodeFriendlyString> unicodeFriendlySet(Iterable<String> strings) {
    final ImmutableSet.Builder<UnicodeFriendlyString> ret = ImmutableSet.builder();

    for (final String s : strings) {
      ret.add(unicodeFriendly(s));
    }

    return ret.build();
  }
837491
public int compareTo (IntTuple ot)
    {
        return (left == ot.left) ? (right - ot.right) : (left - ot.left);
    }
691901
@Override
    public int compareTo(Object obj) {
        if (!this.trusted)
            checkValidity();
        final ByteBuffer other = ((WsByteBuffer) obj).getWrappedByteBufferNonSafe();
        return this.oByteBuffer.compareTo(other);
    }
54569
public int compareTo(ContentCodingType other) {
		int comp = this.type.compareToIgnoreCase(other.type);
		if (comp != 0) {
			return comp;
		}
		comp = this.parameters.size() - other.parameters.size();
		if (comp != 0) {
			return comp;
		}
		TreeSet<String> thisAttributes = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
		thisAttributes.addAll(this.parameters.keySet());
		TreeSet<String> otherAttributes = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
		otherAttributes.addAll(other.parameters.keySet());
		Iterator<String> thisAttributesIterator = thisAttributes.iterator();
		Iterator<String> otherAttributesIterator = otherAttributes.iterator();
		while (thisAttributesIterator.hasNext()) {
			String thisAttribute = thisAttributesIterator.next();
			String otherAttribute = otherAttributesIterator.next();
			comp = thisAttribute.compareToIgnoreCase(otherAttribute);
			if (comp != 0) {
				return comp;
			}
			String thisValue = this.parameters.get(thisAttribute);
			String otherValue = other.parameters.get(otherAttribute);
			if (otherValue == null) {
				otherValue = "";
			}
			comp = thisValue.compareTo(otherValue);
			if (comp != 0) {
				return comp;
			}
		}
		return 0;
	}
648711
@Override
    public int compareTo(final MethodInfo other) {
        final int diff0 = declaringClassName.compareTo(other.declaringClassName);
        if (diff0 != 0) {
            return diff0;
        }
        final int diff1 = name.compareTo(other.name);
        if (diff1 != 0) {
            return diff1;
        }
        return typeDescriptorStr.compareTo(other.typeDescriptorStr);
    }
356497
public static <U extends Key <U>> KeyMatcher <U> keyEquals (final U compareTo)
  {
    return new KeyMatcher <> (compareTo);
  }
168812
public int compareTo(Object o) {
        int thisValue = this.value;
        int thatValue = ((IntWritable) o).value;
        return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
    }
793431
public int compareTo(Object o) {
    UTF8 that = (UTF8)o;
    return WritableComparator.compareBytes(bytes, 0, length,
                                           that.bytes, 0, that.length);
  }
719272
public int compareTo(Object o) {
    long thisValue = this.value;
    long thatValue = ((LongWritable)o).value;
    return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
  }
313792
public int compareTo(Object object) {
        if (image != null)
            return 0;
        if (object == null) {
            return -1;
        }
        PdfFont pdfFont;
        try {
            pdfFont = (PdfFont) object;
            if (font != pdfFont.font) {
                return 1;
            }
            if (this.size() != pdfFont.size()) {
                return 2;
            }
            return 0;
        }
        catch(ClassCastException cce) {
            return -2;
        }
    }
322525
@Override
  public int compareTo(SAXRecord o) {
    int a = this.occurrences.size();
    int b = o.getIndexes().size();
    if (a == b) {
      return 0;
    }
    else if (a > b) {
      return 1;
    }
    return -1;
  }
1143736
@Override
    public int compareTo(ModuleResource o) {
        return (moduleUrl.toString().length() - o.moduleUrl.toString().length());
    }
1003014
@Override
    public int compareTo(Acronym o) {
        int compScore = _shortForm.compareTo(o._shortForm);
        if (compScore == 0) {
            compScore = _longForm.compareTo(o._longForm);
        }
        return compScore;
    }
1177557
public int compareTo(Object o)
    {
        if (o instanceof ServletHolder)
        {
            ServletHolder sh= (ServletHolder)o;
            if (sh==this)
                return 0;
            if (sh._initOrder<_initOrder)
                return 1;
            if (sh._initOrder>_initOrder)
                return -1;
            int c=_className.compareTo(sh._className);
            if (c==0)
                c=_name.compareTo(sh._name);
            if (c==0)
                c=this.hashCode()>o.hashCode()?1:-1;
            return c;
        }
        return 1;
    }
1044693
public int compareTo(Object o) {
    int thisValue = this.value;
    int thatValue = ((VIntWritable)o).value;
    return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
  }
69786
@SuppressWarnings({ "unchecked", "rawtypes" })
    public int compareTo(Object dataCompare)
    { // Override this
        Object data = this.getData();
        if (data == null)
        {
            if (dataCompare == null)
                return 0; // Both null -> equal
            return -1;  // Anything is larger than a null.
        }
        if (dataCompare == null)
            return +1;  // This data is larger than a null
        try   {
            if (data instanceof Comparable)
                return ((Comparable)data).compareTo(dataCompare);
        } catch (ClassCastException ex)   {
            // Possibly different data types, do a string compare.
        }
        String strThis = data.toString();
        String strField = dataCompare.toString();
        return strThis.compareTo(strField);
    }