Implementing the compareTo abstract method.
170761
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof PostfixOperatorNode)) {
            return false;
        }

        return $this->getOperator() == $other->getOperator();
    }
708962
@Override
    public int compareTo(final BlockingState arg0) {
        // effective_date column NOT NULL
        final int comparison = effectiveDate.compareTo(arg0.getEffectiveDate());
        if (comparison == 0) {
            // Keep a stable ordering for ties
            final int comparison2 = createdDate.compareTo(arg0.getCreatedDate());
            if (comparison2 == 0 && arg0 instanceof DefaultBlockingState) {
                final DefaultBlockingState other = (DefaultBlockingState) arg0;
                // New element is last
                if (totalOrdering == null) {
                    return 1;
                } else if (other.getTotalOrdering() == null) {
                    return -1;
                } else {
                    return totalOrdering.compareTo(other.getTotalOrdering());
                }
            } else {
                return comparison2;
            }
        } else {
            return comparison;
        }
    }
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();
		}
	}
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();
	}
212762
@Override
	public int compareTo(CssLink o) {
		if (o == null) {
			return 1;
		}
		return Integer.valueOf(this.precedence).compareTo(o.precedence);
	}
1011798
@Override
  public int compareTo(RuleMatch other) {
    Objects.requireNonNull(other);
    return Integer.compare(getFromPos(), other.getFromPos());
  }
180065
public static <T extends Comparable> int compare(@Nullable T first, @Nullable T second) {
        return compare(first, second, Comparable::compareTo);
    }
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;
  }
991367
@Override
    public int compareTo(LocationWhereValueBecomesNull o) {
        int cmp = this.location.compareTo(o.location);
        if (cmp != 0) {
            return cmp;
        }
        cmp = this.valueNumber.compareTo(o.valueNumber);
        return cmp;
    }
1087144
public static <T> int compareTo(Comparable<T> object1, T object2) {
		if (object1 == object2) {
			return 0;
		}
		if (object1 == null) {
			return Integer.MIN_VALUE;
		}
		if (object2 == null) {
			return Integer.MAX_VALUE;
		}
		assert object1 != null && object2 != null;
		return object1.compareTo(object2);
	}
968210
@Override
    public int compareTo(final MutableByte other) {
        return (this.value > other.value) ? 1 : ((this.value == other.value) ? 0 : -1);
    }
971022
@Override
    public int compareTo(Edge other) {
        int cmp = super.compareTo(other);
        if (cmp != 0) {
            return cmp;
        }
        return type - other.type;
    }
387201
@Override
    public int compareTo(Object obj) {
        int result = -1;
        if (obj instanceof AbstractPlugin) {
            AbstractPlugin test = (AbstractPlugin) obj;
            if (getId() < test.getId()) {
                result = -1;
                
            } else if (getId() > test.getId()) {
                result = 1;
                
            } else {
                result = 0;
            }
        }
        
        return result;
    }
490756
@Override
	public int compareTo(final Problem o) {
		final int ix = this.severity.ordinal();
		final int oid = o.severity.ordinal();
		return ix - oid;
	}
781122
private static int compare(IntegerDBIDVar i1, int p1, IntegerDBIDVar i2, int p2, Comparator<? super DBIDRef> comp) {
    i1.internalSetIndex(p1);
    i2.internalSetIndex(p2);
    return comp.compare(i1, i2);
  }
479063
@Override
	public int compareTo(ValueArray<DoubleValue> o) {
		DoubleValueArray other = (DoubleValueArray) o;

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

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

		return Integer.compare(position, other.position);
	}
296659
@Override
    public int compareTo(Object obj) throws ClassCastException {

        URI another = (URI) obj;
        if (!equals(_authority, another.getRawAuthority())) { 
            return -1;
        }
        return toString().compareTo(another.toString());
    }