/* (non-Javadoc)
@see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
171424
public int compare(Object objA, Object objB)
    {
        if (!(objA instanceof DefBase) || !(objB instanceof DefBase))
        {
            return 0;
        }
        else
        {
            return ((DefBase)objA).getName().compareTo(((DefBase)objB).getName());
        }
    }
1363593
@Override
    public int compare(Snapshot o1, Snapshot o2) {
        return o1.name.compareTo(o2.name);
    }
286563
public int compareTo(Object o)
   {
      MBeanData md = (MBeanData) o;
      String d1 = objectName.getDomain();
      String d2 = md.objectName.getDomain();
      int compare = d1.compareTo(d2);
      if (compare == 0)
      {
         String p1 = objectName.getCanonicalKeyPropertyListString();
         String p2 = md.objectName.getCanonicalKeyPropertyListString();
         compare = p1.compareTo(p2);
      }
      return compare;
   }
43044
@Override
    public int compareTo(final AbstractAttr<String> otherObj) {
        if (otherObj instanceof AttrVersion) {
            AttrVersion other = (AttrVersion) otherObj;
            if (major < other.major) {
                return -1;
            } else if (major > other.major) {
                return 1;
            } else if (minor < other.minor) {
                return -1;
            } else if (minor > other.minor) {
                return 1;
            } else {
                return 0;
            }
        } else {
            return 0;
        }
    }
1052359
@Override
	public int compareTo(CharValue o) {
		final int other = o.value;
		return this.value < other ? -1 : this.value > other ? 1 : 0;
	}
16841
@Override
	public int compareTo(Column o) {
		int diff = name.compareToIgnoreCase(o.name);
		if(diff!=0) return diff;
		return name.compareTo(o.name);
	}
1012410
@Override
    public int compareTo(@NonNull Operation another) {
        return another.definedPriority().priority - definedPriority().priority;
    }
472577
@Override
    public int compareTo(ComparableField rhs) {
        if (rhs instanceof FieldDescriptor) {
            return FieldOrMethodDescriptor.compareTo(this, (FieldDescriptor) rhs);
        }

        if (rhs instanceof XField) {
            return XFactory.compare((XField) this, (XField) rhs);
        }

        throw new ClassCastException("Can't compare a " + this.getClass().getName() + " to a " + rhs.getClass().getName());
    }
165944
@Override
    public int compareTo(byte[] other, int off, int len) {
        ensureTextSet();
        return _comparatorInstance.compare(
                getBytes(), 0, getLength(),
                other, off, len);
    }
766587
@Override
	public int compareTo(ValueArray<StringValue> o) {
		StringValueArray other = (StringValueArray) o;

		// sorts first on number of data in the array, then comparison between
		// the first non-equal element in the arrays
		int cmp = Integer.compare(position, other.position);

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

		for (int i = 0; i < position; i++) {
			cmp = Byte.compare(data[i], other.data[i]);

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

		return 0;
	}
1289264
@Override
    public int compareTo(ComparableField o) {
        if (o instanceof XField) {
            return XFactory.compare((XField) this, (XField) o);
        }
        throw new ClassCastException("Don't know how to compare " + this.getClass().getName() + " to " + o.getClass().getName());

    }
239028
@Override
    public boolean compare(Object object) {
        if (!(object instanceof IAtom)) {
            return false;
        }
        if (!super.compare(object)) {
            return false;
        }
        Atom atom = (Atom) object;
        // XXX: floating point comparision!
        if (((point2d == atom.point2d) || ((point2d != null) && (point2d.equals(atom.point2d))))
            && ((point3d == atom.point3d) || ((point3d != null) && (point3d.equals(atom.point3d))))
            && (Objects.equals(hydrogenCount, atom.hydrogenCount)) && (Objects.equals(stereoParity, atom.stereoParity))
            && (Objects.equals(charge, atom.charge))) {
            return true;
        }
        return false;
    }
1066086
@Pure
	@Override
	@SuppressWarnings({"unchecked", "checkstyle:npathcomplexity"})
	public int compareTo(Object obj) {
		final Object oth = (obj instanceof Reference) ? ((Reference<?>) obj).get() : obj;
		final T cur = get();

		if (oth == null && cur == null) {
			return 0;
		}
		if (cur == null) {
			return 1;
		}
		if (oth == null) {
			return -1;
		}

		if (cur instanceof Comparable) {
			try {
				return ((Comparable<Object>) cur).compareTo(oth);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		if (oth instanceof Comparable) {
			try {
				return -((Comparable<Object>) oth).compareTo(cur);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		return oth.hashCode() - cur.hashCode();
	}
153948
@Override
  public int compareTo(StatusRepresentation o) {
    Long mine = getStatusId();
    Long other = o.getStatusId();
    return mine != null ? (other != null ? mine.compareTo(other) : 1)
        : (mine == other ? 0 : -1);
  }
610302
@Override
	public int compareTo(ApiObjectFieldDoc o) {
		if(this.getOrder().equals(o.getOrder())) {
			return this.getName().compareTo(o.getName());
		} else {
			return this.getOrder() - o.getOrder();
		}
	}
408377
@Override
	public int compare(E entity1, E entity2) {
		T value = property.get(entity1);
		T value2 = property.get(entity2);
		return value.compareTo(value2);
	}
1133139
@Override
    public final JSONCompareResult compareJSON(JSONObject expected, JSONObject actual) throws JSONException {
        JSONCompareResult result = new JSONCompareResult();
        compareJSON("", expected, actual, result);
        return result;
    }