@Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Counter)) { return false; } else { return Counters.equals(this, (Counter<E>) o); } }
/** * Default equality comparison for two counters potentially backed by * alternative implementations. */ public static <E> boolean equals(Counter<E> o1, Counter<E> o2) { return equals(o1, o2, 0.0); }
/** Equality is defined over all Counter implementations. * Two Counters are equal if they have the same keys explicitly stored * with the same values. * <p> * Note that a Counter with a key with value defaultReturnValue will not * be judged equal to a Counter that is lacking that key. In order for * two Counters to be correctly judged equal in such cases, you should * call Counters.retainNonDefaultValues() on both Counters first. * * @param o Object to compare for equality * @return Whether this is equal to o */ @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if ( ! (o instanceof Counter)) { return false; } else if ( ! (o instanceof ClassicCounter)) { return Counters.equals(this, (Counter<E>) o); } final ClassicCounter<E> counter = (ClassicCounter<E>) o; return totalCount == counter.totalCount && map.equals(counter.map); }
/** * Default equality comparison for two counters potentially backed by * alternative implementations. */ public static <E> boolean equals(Counter<E> o1, Counter<E> o2) { return equals(o1, o2, 0.0); }
@Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Counter)) { return false; } else { return Counters.equals(this, (Counter<E>) o); } }
@Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Counter)) { return false; } else { return Counters.equals(this, (Counter<E>) o); } }
@Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Counter)) { return false; } else { return Counters.equals(this, (Counter<E>) o); } }
/** * Default equality comparison for two counters potentially backed by * alternative implementations. */ public static <E> boolean equals(Counter<E> o1, Counter<E> o2) { return equals(o1, o2, 0.0); }
/** * Default equality comparison for two counters potentially backed by * alternative implementations. */ public static <E> boolean equals(Counter<E> o1, Counter<E> o2) { return equals(o1, o2, 0.0); }
@Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if (! (o instanceof Counter)) { return false; } else { return Counters.equals(this, (Counter<E>) o); } }
/** Equality is defined over all Counter implementations. * Two Counters are equal if they have the same keys explicitly stored * with the same values. * <p> * Note that a Counter with a key with value defaultReturnValue will not * be judged equal to a Counter that is lacking that key. In order for * two Counters to be correctly judged equal in such cases, you should * call Counters.retainNonDefaultValues() on both Counters first. * * @param o Object to compare for equality * @return Whether this is equal to o */ @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if ( ! (o instanceof Counter)) { return false; } else if ( ! (o instanceof ClassicCounter)) { return Counters.equals(this, (Counter<E>) o); } final ClassicCounter<E> counter = (ClassicCounter<E>) o; return totalCount == counter.totalCount && map.equals(counter.map); }
/** Equality is defined over all Counter implementations. * Two Counters are equal if they have the same keys explicitly stored * with the same values. * <p> * Note that a Counter with a key with value defaultReturnValue will not * be judged equal to a Counter that is lacking that key. In order for * two Counters to be correctly judged equal in such cases, you should * call Counters.retainNonDefaultValues() on both Counters first. * * @param o Object to compare for equality * @return Whether this is equal to o */ @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if ( ! (o instanceof Counter)) { return false; } else if ( ! (o instanceof ClassicCounter)) { return Counters.equals(this, (Counter<E>) o); } final ClassicCounter<E> counter = (ClassicCounter<E>) o; return totalCount == counter.totalCount && map.equals(counter.map); }
/** Equality is defined over all Counter implementations. * Two Counters are equal if they have the same keys explicitly stored * with the same values. * <p> * Note that a Counter with a key with value defaultReturnValue will not * be judged equal to a Counter that is lacking that key. In order for * two Counters to be correctly judged equal in such cases, you should * call Counters.retainNonDefaultValues() on both Counters first. * * @param o Object to compare for equality * @return Whether this is equal to o */ @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if ( ! (o instanceof Counter)) { return false; } else if ( ! (o instanceof ClassicCounter)) { return Counters.equals(this, (Counter<E>) o); } final ClassicCounter<E> counter = (ClassicCounter<E>) o; return totalCount == counter.totalCount && map.equals(counter.map); }
/** Equality is defined over all Counter implementations. * Two Counters are equal if they have the same keys explicitly stored * with the same values. * <p> * Note that a Counter with a key with value defaultReturnValue will not * be judged equal to a Counter that is lacking that key. In order for * two Counters to be correctly judged equal in such cases, you should * call Counters.retainNonDefaultValues() on both Counters first. * * @param o Object to compare for equality * @return Whether this is equal to o */ @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { if (this == o) { return true; } else if ( ! (o instanceof Counter)) { return false; } else if ( ! (o instanceof ClassicCounter)) { return Counters.equals(this, (Counter<E>) o); } final ClassicCounter<E> counter = (ClassicCounter<E>) o; return totalCount == counter.totalCount && map.equals(counter.map); }