public String toString() { Iterator<E> i = iterator(); if (!i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append('{'); for (; ;) { E e = i.next(); sb.append(e == this ? "(this Collection)" : e); if (!i.hasNext()) return sb.append('}').toString(); sb.append(", "); } } }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @SuppressWarnings({"unchecked", "SimplifiableIfStatement"}) public boolean equals(Object other) { if (!(other instanceof Map)) { return false; } Map<K, V> that = (Map<K, V>) other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure<K, V>(that)); }
/** * See {@link * gnu.trove.map.hash.THashMap#forEachEntry(gnu.trove.procedure.TObjectObjectProcedure)} */ public boolean forEachEntry(TObjectObjectProcedure<? super K, ? super V> procedure) { return delegate.forEachEntry(procedure::execute); }
/** * See {@link * gnu.trove.map.hash.THashMap#forEachEntry(gnu.trove.procedure.TObjectObjectProcedure)} */ public boolean forEachEntry(TObjectObjectProcedure<? super K, ? super V> procedure) { return delegate.forEachEntry(procedure::execute); }
public String toString() { Iterator<E> i = iterator(); if (!i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append('{'); for (; ;) { E e = i.next(); sb.append(e == this ? "(this Collection)" : e); if (!i.hasNext()) return sb.append('}').toString(); sb.append(", "); } } }
@Override public String toString() { Iterator<E> i = iterator(); if (!i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append('{'); for (; ;) { E e = i.next(); sb.append(e == this ? "(this Collection)" : e); if (!i.hasNext()) return sb.append('}').toString(); sb.append(", "); } } }
public String toString() { Iterator<E> i = iterator(); if (!i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append('{'); for (; ;) { E e = i.next(); sb.append(e == this ? "(this Collection)" : e); if (!i.hasNext()) return sb.append('}').toString(); sb.append(", "); } } }
public String toString() { Iterator<E> i = iterator(); if ( !i.hasNext() ) return "{}"; StringBuilder sb = new StringBuilder(); sb.append( '{' ); for (; ; ) { E e = i.next(); sb.append( e == this ? "(this Collection)" : e ); if ( !i.hasNext() ) return sb.append( '}' ).toString(); sb.append( ", " ); } } }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @SuppressWarnings({"unchecked", "SimplifiableIfStatement"}) public boolean equals( Object other ) { if ( !( other instanceof Map ) ) { return false; } Map<K, V> that = (Map<K, V>) other; if ( that.size() != this.size() ) { return false; } return forEachEntry( new EqProcedure<K, V>( that ) ); }
@Override public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry( p ); return p.getHashCode(); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @SuppressWarnings({"unchecked", "SimplifiableIfStatement"}) public boolean equals(Object other) { if (!(other instanceof Map)) { return false; } Map<K, V> that = (Map<K, V>) other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure<K, V>(that)); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @SuppressWarnings({"unchecked", "SimplifiableIfStatement"}) public boolean equals(Object other) { if (!(other instanceof Map)) { return false; } Map<K, V> that = (Map<K, V>) other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure<K, V>(that)); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override @SuppressWarnings({"unchecked"}) public boolean equals(Object other) { if (!(other instanceof Map)) { return false; } Map<K, V> that = (Map<K, V>) other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }