This comparator compares entries by the length of the entries array - i.e. by the total
frequency of entry occurrence.

@param o an entry to compare with.
@return results of comparison.
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;
  }
932926
@Override
  public int compareTo(ColumnDatapointIterator o) {
    int c = current_timestamp_offset - o.current_timestamp_offset;
    if (c == 0) {
      // note inverse order of comparison!
      c = Long.signum(o.column_timestamp - column_timestamp);
    }
    return c;
  }
901577
public int compareTo(PageRef o) {
		int diff = bookRef.compareTo(o.bookRef);
		if(diff != 0) return diff;
		return getPath().compareTo(o.getPath());
	}
507965
@Override
	public int compare(E o1, E o2) {
		return comparator.compare(o2, o1);
	}
622217
@Override
    public int compareTo(PrefixedChecksummedBytes o) {
        int result = this.params.getId().compareTo(o.params.getId());
        return result != 0 ? result : UnsignedBytes.lexicographicalComparator().compare(this.bytes, o.bytes);
    }
1078397
public static <T extends Comparable<T>> int compare(T o1, T o2) {
		if(o1 == null) {
			return o2 == null ? 0 : 1;
		} else if(o2 == null) {
			return -1;
		} else {
			return o1.compareTo(o2);
		}
	}
518976
public int compareTo(ByteSequence obs) {
        if (isBackedByArray() && obs.isBackedByArray()) {
            return WritableComparator.compareBytes(getBackingArray(), offset(), length(), obs.getBackingArray(), obs.offset(), obs.length());
        }

        return compareBytes(this, obs);
    }
563513
@Override
	public int compareTo(ValueArray<ShortValue> o) {
		ShortValueArray other = (ShortValueArray) o;

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

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

		return Integer.compare(position, other.position);
	}
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());
    }
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;
   }
1069717
@Override
    public int compareTo(DiscriminationGroup o) {
        if (o == null || !(o instanceof DiscriminationProcessImpl)) {
            return -1;
        }
        return o.hashCode() - hashCode();
    }
34681
public int compareTo(LogPosition o) {
        final int val = fileName.compareTo(o.fileName);

        if (val == 0) {
            return (int) (position - o.position);
        }
        return val;
    }
1239574
@Override
    public int compareTo(final FastZipEntry o) {
        final int diff0 = o.version - this.version;
        if (diff0 != 0) {
            return diff0;
        }
        final int diff1 = entryNameUnversioned.compareTo(o.entryNameUnversioned);
        if (diff1 != 0) {
            return diff1;
        }
        final int diff2 = entryName.compareTo(o.entryName);
        if (diff2 != 0) {
            return diff2;
        }
        // In case of multiple entries with the same entry name, return them in consecutive order of location,
        // so that the earliest entry overrides later entries (this is an arbitrary decision for consistency)
        final long diff3 = locHeaderPos - o.locHeaderPos;
        return diff3 < 0L ? -1 : diff3 > 0L ? 1 : 0;
    }
1223960
@Override
  public int compareTo(ID o) {
    JobID that = (JobID)o;
    int jtComp = this.jtIdentifier.compareTo(that.jtIdentifier);
    if(jtComp == 0) {
      return this.id - that.id;
    }
    else return jtComp;
  }
421850
@Override
    public int compareTo(ObserverMethod o) {
        if (o == null) {
            return 1;
        }
        Integer a = getPresedence(getMethod());
        Integer b = getPresedence(o.getMethod());
        return b.compareTo(a);
    }
96941
public final int compareTo(AbstractRule o)
	{
		Integer us = new Integer(this.getSpecificity());
		Integer them = new Integer(o.getSpecificity());
		return them.compareTo(us);
	}
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;
	}