/** * Creates a new <code>TIntByteHashMap</code> instance containing * all of the entries in the map passed in. * * @param keys a <tt>int</tt> array containing the keys for the matching values. * @param values a <tt>byte</tt> array containing the values. */ public TIntByteHashMap( int[] keys, byte[] values ) { super( Math.max( keys.length, values.length ) ); int size = Math.min( keys.length, values.length ); for ( int i = 0; i < size; i++ ) { this.put( keys[i], values[i] ); } }
/** {@inheritDoc} */ public void putAll( Map<? extends Integer, ? extends Byte> map ) { ensureCapacity( map.size() ); // could optimize this for cases when map instanceof THashMap for ( Map.Entry<? extends Integer, ? extends Byte> entry : map.entrySet() ) { this.put( entry.getKey().intValue(), entry.getValue().byteValue() ); } }
/** {@inheritDoc} */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // SUPER super.readExternal( in ); // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while (size-- > 0) { int key = in.readInt(); byte val = in.readByte(); put(key, val); } } } // TIntByteHashMap
/** {@inheritDoc} */ public void putAll( TIntByteMap map ) { ensureCapacity( map.size() ); TIntByteIterator iter = map.iterator(); while ( iter.hasNext() ) { iter.advance(); this.put( iter.key(), iter.value() ); } }
@Override public byte set(int key, byte value) { return data.put(key, value); }
/** * Creates a new <code>TIntByteHashMap</code> instance containing * all of the entries in the map passed in. * * @param keys a <tt>int</tt> array containing the keys for the matching values. * @param values a <tt>byte</tt> array containing the values. */ public TIntByteHashMap( int[] keys, byte[] values ) { super( Math.max( keys.length, values.length ) ); int size = Math.min( keys.length, values.length ); for ( int i = 0; i < size; i++ ) { this.put( keys[i], values[i] ); } }
/** * Creates a new <code>TIntByteHashMap</code> instance containing * all of the entries in the map passed in. * * @param keys a <tt>int</tt> array containing the keys for the matching values. * @param values a <tt>byte</tt> array containing the values. */ public TIntByteHashMap( int[] keys, byte[] values ) { super( Math.max( keys.length, values.length ) ); int size = Math.min( keys.length, values.length ); for ( int i = 0; i < size; i++ ) { this.put( keys[i], values[i] ); } }
/** * Creates a new <code>TIntByteHashMap</code> instance containing * all of the entries in the map passed in. * * @param keys a <tt>int</tt> array containing the keys for the matching values. * @param values a <tt>byte</tt> array containing the values. */ public TIntByteHashMap( int[] keys, byte[] values ) { super( Math.max( keys.length, values.length ) ); int size = Math.min( keys.length, values.length ); for ( int i = 0; i < size; i++ ) { this.put( keys[i], values[i] ); } }
/** * Creates a new <code>TIntByteHashMap</code> instance containing * all of the entries in the map passed in. * * @param keys a <tt>int</tt> array containing the keys for the matching values. * @param values a <tt>byte</tt> array containing the values. */ public TIntByteHashMap( int[] keys, byte[] values ) { super( Math.max( keys.length, values.length ) ); int size = Math.min( keys.length, values.length ); for ( int i = 0; i < size; i++ ) { this.put( keys[i], values[i] ); } }
/** {@inheritDoc} */ public void putAll( Map<? extends Integer, ? extends Byte> map ) { ensureCapacity( map.size() ); // could optimize this for cases when map instanceof THashMap for ( Map.Entry<? extends Integer, ? extends Byte> entry : map.entrySet() ) { this.put( entry.getKey().intValue(), entry.getValue().byteValue() ); } }
/** {@inheritDoc} */ public void putAll( Map<? extends Integer, ? extends Byte> map ) { ensureCapacity( map.size() ); // could optimize this for cases when map instanceof THashMap for ( Map.Entry<? extends Integer, ? extends Byte> entry : map.entrySet() ) { this.put( entry.getKey().intValue(), entry.getValue().byteValue() ); } }
/** {@inheritDoc} */ public void putAll( Map<? extends Integer, ? extends Byte> map ) { ensureCapacity( map.size() ); // could optimize this for cases when map instanceof THashMap for ( Map.Entry<? extends Integer, ? extends Byte> entry : map.entrySet() ) { this.put( entry.getKey().intValue(), entry.getValue().byteValue() ); } }
/** {@inheritDoc} */ @Override public void putAll( Map<? extends Integer, ? extends Byte> map ) { ensureCapacity( map.size() ); // could optimize this for cases when map instanceof THashMap for ( Map.Entry<? extends Integer, ? extends Byte> entry : map.entrySet() ) { this.put( entry.getKey().intValue(), entry.getValue().byteValue() ); } }
/** {@inheritDoc} */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // SUPER super.readExternal( in ); // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while (size-- > 0) { int key = in.readInt(); byte val = in.readByte(); put(key, val); } } } // TIntByteHashMap
@Override public SparseByteArray reverse() { //TODO: this could be more efficient and avoid the copy TIntByteHashMap tmp = new TIntByteHashMap(data.size()); for (Entry e : entries()) tmp.put(length - e.index, e.value); this.data = tmp; return this; } }
/** {@inheritDoc} */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // SUPER super.readExternal( in ); // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while (size-- > 0) { int key = in.readInt(); byte val = in.readByte(); put(key, val); } } } // TIntByteHashMap
/** {@inheritDoc} */ public void putAll( TIntByteMap map ) { ensureCapacity( map.size() ); TIntByteIterator iter = map.iterator(); while ( iter.hasNext() ) { iter.advance(); this.put( iter.key(), iter.value() ); } }
/** {@inheritDoc} */ public void putAll( TIntByteMap map ) { ensureCapacity( map.size() ); TIntByteIterator iter = map.iterator(); while ( iter.hasNext() ) { iter.advance(); this.put( iter.key(), iter.value() ); } }
/** {@inheritDoc} */ public void putAll( TIntByteMap map ) { ensureCapacity( map.size() ); TIntByteIterator iter = map.iterator(); while ( iter.hasNext() ) { iter.advance(); this.put( iter.key(), iter.value() ); } }
/** {@inheritDoc} */ @Override public void putAll( TIntByteMap map ) { ensureCapacity( map.size() ); TIntByteIterator iter = map.iterator(); while ( iter.hasNext() ) { iter.advance(); this.put( iter.key(), iter.value() ); } }