<p>
compare.
</p>

@param what0 a {@link java.lang.String} object.
@param what1 a {@link java.lang.String} object.
@return a int.
769517
public int compare(final String what0, final String what1) {
    return (asc ? 1 : -1) * (collator.compare((null == what0) ? "" : what0, (null == what1) ? "" : what1));
  }
486021
@Override
	public int compareTo(final Object o) {

		final long otherId = ((BoltIdentity)o).getId();

		if (id > otherId) {
			return 1;
		}

		if (id < otherId) {
			return -1;
		}

		return 0;
	}
955445
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
        if (o1 == o2) return 0;
        if (o1 != null) {
            if (o2 == null) return 1;
            else return o1.phraseText.compareTo(o2.phraseText);
        }
        return -1;
    }
922079
public int compareTo(Error s) {
    if (getStart() < s.getStart()) {
      return -1;
    } else if (getStart() == s.getStart()) {
      if (getEnd() > s.getEnd()) {
        return -1;
      } else if (getEnd() < s.getEnd()) {
        return 1;
      } else {
        return 0;
      }
    } else {
      return 1;
    }
  }
1282823
public int compareTo(Object o) {
    int thisValue = this.value;
    int thatValue = ((ByteWritable)o).value;
    return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
  }
891341
public int compareTo(Object o)
		{
			final int rhs = o.hashCode();
			return hashCode() < rhs ? -1 : hashCode() > rhs ? 1 : 0;
		}
14269
static public int compare(Name n1, Name n2) {
    int ret = n1.namespaceUri.compareTo(n2.namespaceUri);
    if (ret != 0)
      return ret;
    return n1.localName.compareTo(n2.localName);
  }
1032341
public int compare(String a, String b) {

        int i;

        if (collator == null) {
            i = a.compareTo(b);
        } else {
            i = collator.compare(a, b);
        }

        return (i == 0) ? 0
                        : (i < 0 ? -1
                                 : 1);
    }
719272
public int compareTo(Object o) {
    long thisValue = this.value;
    long thatValue = ((LongWritable)o).value;
    return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
  }
1104121
@Override public int compareTo(Annotation that) {
    if (this == that) return 0;
    int byTimestamp = timestamp() < that.timestamp() ? -1 : timestamp() == that.timestamp() ? 0 : 1;
    if (byTimestamp != 0) return byTimestamp;
    return value().compareTo(that.value());
  }
180103
@Override
  public int compare(String s1, String s2) {
    if (s1 == s2) { // NOSONAR false-positive: Compare Objects With Equals
      return 0;
    }
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    if (h1 < h2) {
      return -1;
    } else if (h1 > h2) {
      return 1;
    } else {
      return s1.compareTo(s2);
    }
  }
470306
public static <T> int compare(T o1, T o2, Comparator<T> comparator) {
		if(o1 == null) {
			return o2 == null ? 0 : 1;
		} else if(o2 == null) {
			return -1;
		} else {
			return comparator.compare(o1, o2);
		}
	}
369227
@Override
  public int compareTo(Comparable<?> other) {
    if (other instanceof Region) {
      Region r = (Region) other;
      if (this.start < r.start) {
        return -1;
      } else if (this.end > r.end) {
        return 1;
      } else {
        return 0;
      }
    } else if (other instanceof Long) {
      Long l = (Long) other;
      if (l > end) {
          return -1;
      } else if (l < start) {
          return 1;
      } else {
          return 0;
      }
    } else {
      throw new AssertionError();
    }
  }
271503
@Override
    public int compareTo(Sha1Wrapper arg0) {
        if (arg0 == null) return 1;
        for (int i = 0; i < 20; i++) {
            int cmp = hashBytes[i] - arg0.hashBytes[i];
            if (cmp != 0) return cmp;
        }
        return 0;
    }
1057259
@Override
    public int compareTo(MessageVersion that) {
        if (that == null) {
            return 1;
        }

        Integer[] thisParts = getVersionParts();
        Integer[] thatParts = that.getVersionParts();

        int length = Math.max(thisParts.length, thatParts.length);

        for (int i = 0; i < length; i++) {

            int comp = getVersionPart(thisParts, i) - getVersionPart(thatParts, i);

            if (comp != 0) {
                return comp;
            }
        }
        return 0;
    }
446138
@Override
    public int compareTo(final AnnotationParameterValue other) {
        if (other == this) {
            return 0;
        }
        final int diff = name.compareTo(other.getName());
        if (diff != 0) {
            return diff;
        }
        if (value.equals(other.value)) {
            return 0;
        }
        // Use toString() order (which can be slow) as a last-ditch effort -- only happens
        // if the annotation has multiple parameters of the same name but different value. 
        final Object p0 = getValue();
        final Object p1 = other.getValue();
        return p0 == null || p1 == null ? (p0 == null ? 0 : 1) - (p1 == null ? 0 : 1)
                : toStringParamValueOnly().compareTo(other.toStringParamValueOnly());
    }
1216696
@Override
    public int compare(String o1, String o2) {

        if (o1.equals(o2)) {
            return 0;
        }

        String prefix = Strings.commonPrefix(o1, o2);
        if (prefix.length() == 0) {
            // No common prefix
            return o1.compareTo(o2);
        }

        if (o1.length() == prefix.length()) {
            return -1;
        }

        return o1.compareTo(o2);

    }