Compares two IntWritables.
168812
public int compareTo(Object o) {
        int thisValue = this.value;
        int thatValue = ((IntWritable) o).value;
        return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
    }
949624
private static int compareLobContents(final IonLob lob1, final IonLob lob2)
    {
        int in1 = lob1.byteSize();
        int in2 = lob2.byteSize();
        int result = (in1- in2);

        if (result == 0) {
            final InputStream stream1 = lob1.newInputStream();
            final InputStream stream2 = lob2.newInputStream();

            // too bad Java doesn't do RAII with better syntax...
            try {
              try {
                try {
                  while (result == 0) {
                      in1 = stream1.read();
                      in2 = stream2.read();
                      if (in1 == -1 || in2 == -1) {
                        if (in1 != -1) result = 1;
                        if (in2 != -1) result = -1;
                        break;
                      }
                      result = (in1 - in2);
                  }
                } finally {
                  stream1.close();
                }
              } finally {
                stream2.close();
              }
            } catch (final IOException e) {
                // XXX hopefully won't happen with LOB streams--if it does rethrow unchecked.
                //     this would violate Object.equals() would it not?
                throw new IonException(e);
            }
        }

        return result;
    }
982168
protected static int compareLexicographical(Itemset a, Itemset o) {
    int i1 = a.iter(), i2 = o.iter();
    while(a.iterValid(i1) && o.iterValid(i2)) {
      int v1 = a.iterDim(i1), v2 = o.iterDim(i2);
      if(v1 < v2) {
        return -1;
      }
      if(v2 < v1) {
        return +1;
      }
      i1 = a.iterAdvance(i1);
      i2 = o.iterAdvance(i2);
    }
    return a.iterValid(i1) ? 1 : o.iterValid(i2) ? -1 : 0;
  }
467302
@Override
    public int compare(final Issue i1, final Issue i2) {

        if (null == i1 && null == i2) {
            return 0;
        } else if (null == i1) {
            return 1;
        } else if (null == i2) {
            return -1;
        } else {
            return i1.getCreatedOn().compareTo(i2.getCreatedOn());
        }
    }
1185213
@Override
  public int compareTo(IVersion other)
  {
    if (other instanceof SemanticVersion) {
      SemanticVersion sv = (SemanticVersion) other;
      // If neither is named, then compare them as semantic values
      return this.head.compareTo(sv.head);
    }
    else {
      // Fall back to simple string comparison
      return toString().compareTo(other.toString());
    }
  }
1279352
function compareSpecificity(first, second) {
    for (var i = 0; i < first.length; i++) {
        var a = first[i];
        var b = second[i];

        if (a === b) {
            continue;
        }

        return a - b;
    }

    return 0;
}
1277608
public static void inferiorOrEqual(int a, int b)
    {
        if (a > b)
        {
            throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_INFERIOR + String.valueOf(b));
        }
    }
719272
public int compareTo(Object o) {
    long thisValue = this.value;
    long thatValue = ((LongWritable)o).value;
    return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
  }
137966
public int compare(NUMERICTYPE value1, NUMERICTYPE value2) {
        if (this.performCalculationsAsDoublePrimitive) {
            double v1 = value1.doubleValue();
            double v2 = value2.doubleValue();
            return Double.compare(v1, v2);
        } else {
            // evaluate as long
            long v1 = value1.longValue();
            long v2 = value2.longValue();
            return Long.compare(v1, v2);
        }

    }
404759
@Override
    public int compareTo(Object o) {
        if (o instanceof ICpe) {
            ICpe otherObject = (ICpe) o;

            final int before = -1;
            final int equal = 0;
            final int after = 1;

            if (this == otherObject) {
                return equal;
            }
            int r = getPart().getAbbreviation().compareTo(otherObject.getPart().getAbbreviation());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getVendor().compareTo(otherObject.getVendor());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getProduct().compareTo(otherObject.getProduct());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = compareVersions(getVersion(), otherObject.getVersion());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getUpdate().compareTo(otherObject.getUpdate());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getEdition().compareTo(otherObject.getEdition());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getLanguage().compareTo(otherObject.getLanguage());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getSwEdition().compareTo(otherObject.getSwEdition());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getTargetSw().compareTo(otherObject.getTargetSw());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getTargetHw().compareTo(otherObject.getTargetHw());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            r = getOther().compareTo(otherObject.getOther());
            if (r < 0) {
                return before;
            } else if (r > 0) {
                return after;
            }
            return equal;
        }
        throw new RuntimeException("Unable to compare " + o.getClass().getCanonicalName());
    }
836359
private int compare(Reference<E> e1, Reference<E> e2) {
        return comparator.compare(e1.element, e2.element);
    }
399216
public int compare(Attribute a, Attribute b) {
        int result = a.getId().toString().compareTo(b.getId().toString());

        if (result == 0) {
            result = a.getType().toString().compareTo(b.getType().toString());
        } else {
            return result;
        }

        if (result == 0) {
            result = a.getValue().encode().compareTo(b.getValue().encode());
        } else {
            return result;
        }

        if (result == 0
                && (a.getIssueInstant() != null || b.getIssueInstant() != null)) {
            if (a.getIssueInstant() == null && b.getIssueInstant() == null) {
                result = 0;
            } else if (a.getIssueInstant() != null
                    && b.getIssueInstant() == null) {
                result = 1;
            } else if (a.getIssueInstant() == null
                    && b.getIssueInstant() != null) {
                result = -1;
            } else {
                result =
                        a.getIssueInstant().encode().compareTo(b
                                .getIssueInstant().encode());
            }
        }

        return result;
    }
22727
public static int typeCompareTo(Writable one, Writable other) {
        PrimitiveObject noOne = hadoop2Primitive(one);
        PrimitiveObject noOther = hadoop2Primitive(other);
        if (noOne.getType() != noOther.getType()) {
            return -1;
        }

        return 0;
    }
1046137
private static int compareObject(Object a, Object b, final ASTNode node1, final ASTNode node2, String type)
	{
		if (a instanceof Comparable && b instanceof Comparable)
		{
			Comparable ac = (Comparable) a;
			try
			{
				int result = ac.compareTo(b);
				if (result > 0)
					return 1;
				else if (result < 0)
					return -1;
				return result;
			}

			catch (RuntimeException e)
			{
				BeetlException ex = new BeetlException(BeetlException.EXPRESSION_NOT_COMPATIBLE, e);
				GrammarToken token = GrammarToken.createToken(node1.token.text + " " + node2.token.text,
						node1.token.line);
				ex.pushToken(token);
				throw ex;
			}

		}
		else
		{
			return -2;
		}
	}
186919
private int compareToLFU( CacheEntry other ) {

        int cmp = compareReadCount( other );
        if ( cmp != 0 ) {
            return cmp;
        }

        cmp = compareTime( other );
        if ( cmp != 0 ) {
            return cmp;
        }

        return compareOrder( other );
    }
690422
def compare(string1, string2):
    
    if len(string1) != len(string2):
        return False
    result = True
    for c1, c2 in izip(string1, string2):
        result &= c1 == c2
    return result
825727
private int compareIdentifiers(String ident1, String ident2) {
        if (isInt(ident1) && isInt(ident2)) {
            return Integer.parseInt(ident1) - Integer.parseInt(ident2);
        } else {
            return ident1.compareTo(ident2);
        }
    }