/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TByteObjectMap ) ) { return false; } TByteObjectMap that = ( TByteObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TByteObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); byte key = iter.key(); Object value = iter.value(); if ( value == null ) { if ( !( that.get( key ) == null && that.containsKey( key ) ) ) { return false; } } else { if ( !value.equals( that.get( key ) ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
public V put( byte key, V value ) { synchronized( mutex ) { return m.put( key, value ); } } public V remove( byte key ) {
/** {@inheritDoc} */ public void putAll( TByteObjectMap<? extends V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Byte && _map.containsKey( ( ( Byte ) key ).byteValue() ); }
/** * Creates a new <code>TByteObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TByteObjectMap</tt> to be copied. */ public TByteObjectHashMap( TByteObjectMap<? extends V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Byte</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or <tt>null</tt> if none was found. */ public V put( Byte key, V value ) { byte k; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } return _map.put( k, value ); }
public V get( byte key ) { synchronized( mutex ) { return m.get( key ); } }
/** * @return An iterable of the registered blocks */ @Override public Iterable<Block> getBlocks() { return blocks.valueCollection(); } }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public V get( Object key ) { byte k; if ( key != null ) { if ( key instanceof Byte ) { k = unwrapKey( ( Byte ) key ); } else { return null; } } else { k = _map.getNoEntryKey(); } return _map.get( k ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { return _map.containsValue( val ); }
/** * Empties the map. */ public void clear() { this._map.clear(); }
public boolean forEachKey( TByteProcedure procedure ) { synchronized( mutex ) { return m.forEachKey( procedure ); } } public boolean forEachValue( TObjectProcedure<? super V> procedure ) {
public boolean forEachValue( TObjectProcedure<? super V> procedure ) { return m.forEachValue( procedure ); } public boolean forEachEntry( TByteObjectProcedure<? super V> procedure ) {
protected TextureArea[] getOverlaysForSlot(boolean isOutput, boolean isFluid, boolean isLast) { TextureArea base = isFluid ? GuiTextures.FLUID_SLOT : GuiTextures.SLOT; if(!isOutput && !isFluid && isLast && recipeBuilderSample instanceof IntCircuitRecipeBuilder) { //automatically add int circuit overlay to last item input slot return new TextureArea[]{base, GuiTextures.INT_CIRCUIT_OVERLAY}; } byte overlayKey = (byte) ((isOutput ? 2 : 0) + (isFluid ? 1 : 0) + (isLast ? 4 : 0)); if(slotOverlays.containsKey(overlayKey)) { return new TextureArea[] {base, slotOverlays.get(overlayKey)}; } return new TextureArea[] {base}; }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public V remove( Object key ) { byte k; if ( key != null ) { if ( key instanceof Byte ) { k = unwrapKey( ( Byte ) key ); } else { return null; } } else { k = _map.getNoEntryKey(); } return _map.remove( k ); }
public boolean containsKey( byte key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( Object value ){
public byte getNoEntryKey() { return m.getNoEntryKey(); }
public V get( byte key) { return m.get( key ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Byte && _map.containsKey( ( ( Byte ) key ).byteValue() ); }
/** * Returns only unique rotations, in respect to transformations, rather than in respect to yaw, pitch & roll. * * @return Unique rotations, in respect to transformations. */ public static Iterable<Rotation> values() { return NORMALIZED_ROTATIONS.valueCollection(); } }