/** * 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 */ public boolean equals( Object other ) { if ( ! ( other instanceof TObjectByteMap ) ) { return false; } TObjectByteMap that = ( TObjectByteMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectByteIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); byte value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
/** * 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("rawtypes") public boolean equals( Object other ) { if ( ! ( other instanceof TObjectByteMap ) ) { return false; } TObjectByteMap that = ( TObjectByteMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectByteIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); byte value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
/** * 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 */ public boolean equals( Object other ) { if ( ! ( other instanceof TObjectByteMap ) ) { return false; } TObjectByteMap that = ( TObjectByteMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectByteIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); byte value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. logger.warn("An error occurred!", ex); } return true; }
public Map<String, Byte> getBlockIdMap() { Map<String, Byte> result = Maps.newHashMapWithExpectedSize(idByUri.size()); TObjectByteIterator<BlockUri> iterator = idByUri.iterator(); while (iterator.hasNext()) { iterator.advance(); result.put(iterator.key().toString(), iterator.value()); } return result; }
/** * @return an iterator over the entries in this map */ public TObjectByteIterator<K> iterator() { return new TObjectByteHashIterator<K>( this ); }
/** * @return an iterator over the entries in this map */ @Override public TObjectByteIterator<K> iterator() { return new TObjectByteHashIterator( this ); }
public TObjectByteIterator<K> iterator() { return container.iterator(); }
public TObjectByteIterator<String> iterator() { return container.iterator(); }
/** * Returns a <tt>TObjectByteIterator</tt> with access to this map's keys and values. * * @return a <tt>TObjectByteIterator</tt> with access to this map's keys and values. */ public TObjectByteIterator<K> iterator();