Java 类gnu.trove.iterator.TObjectFloatIterator 实例源码

项目:DynamicSurroundings    文件:AreaSoundEffectHandler.java   
private static void getBiomeSounds(@Nonnull final TObjectFloatHashMap<SoundEffect> result) {
    // Need to collect sounds from all the applicable biomes
    // along with their weights.
    final TObjectIntIterator<BiomeInfo> info = AreaSurveyHandler.getBiomes().iterator();
    while (info.hasNext()) {
        info.advance();
        final List<SoundEffect> bs = new ArrayList<SoundEffect>();
        info.key().findSoundMatches(bs);
        for (final SoundEffect sound : bs) {
            final int w = info.value();
            result.adjustOrPutValue(sound, w, w);
        }
    }

    // Scale the volumes in the resulting list based on the weights
    final int area = AreaSurveyHandler.getBiomeArea();
    final TObjectFloatIterator<SoundEffect> itr = result.iterator();
    while (itr.hasNext()) {
        itr.advance();
        final float scale = 0.1F + 0.9F * ((float) itr.value() / (float) area);
        itr.setValue(scale);
    }
}
项目:pre-cu    文件:HateList.java   
public List<ImmutableHateListEntry> getSortedList() {
    //TODO: Why don't we just keep a sorted list in the first place?!
    final List<ImmutableHateListEntry> sortedList = new ArrayList<>(hateList.size());

    if (!hateList.isEmpty()) {
        final TObjectFloatIterator<GameObject> iterator = hateList.iterator();

        while (iterator.hasNext()) {
            iterator.advance();
            sortedList.add(new ImmutableHateListEntry(iterator.key().getNetworkId(), iterator.value()));
        }

        //Sort the targets based on the most hate.
        Collections.sort(sortedList, (a, b) -> Float.compare(a.hate, b.hate) * -1);
    }

    return sortedList;
}
项目:pre-cu    文件:HateList.java   
public void findNewTarget() {
    //This method should be moved to a service somewhere as it needs access to a list of all objects.
    long targetId = NetworkObject.INVALID;
    float maxHate = 0.0f;

    final TObjectFloatIterator<GameObject> iterator = hateList.iterator();

    while (iterator.hasNext()) {
        iterator.advance();

        if (iterator.key() == null) {
            continue; //This can't actually happen. SOE does a lookup to try and get the object.
        }

        if (iterator.value() == maxHate || targetId == NetworkObject.INVALID) {
            targetId = iterator.key().getNetworkId();
            maxHate = iterator.value();
        }
    }

    setTarget(targetId, maxHate);
}
项目:xcc    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:xcc    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:HCFCore    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:HCFCore    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:HCFCore    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:HCFCore    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:trove-3.0.3    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:trove-3.0.3    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:DynamicSurroundings    文件:SoundEffectHandler.java   
public void queueAmbientSounds(@Nonnull final TObjectFloatHashMap<SoundEffect> sounds) {
    // Iterate through the existing emitters:
    // * If done, remove
    // * If not in the incoming list, fade
    // * If it does exist, update volume throttle and unfade if needed
    final Iterator<Entry<SoundEffect, Emitter>> itr = this.emitters.entrySet().iterator();
    while (itr.hasNext()) {
        final Entry<SoundEffect, Emitter> e = itr.next();
        final Emitter emitter = e.getValue();
        if (emitter.isDonePlaying()) {
            DSurround.log().debug("Removing emitter: %s", emitter.toString());
            itr.remove();
        } else if (sounds.contains(e.getKey())) {
            emitter.setVolumeThrottle(sounds.get(e.getKey()));
            if (emitter.isFading())
                emitter.unfade();
            // Set to 0 so that the "new sound" logic below
            // will ignore. Cheaper than removing the object
            // from the collection.
            sounds.put(e.getKey(), 0F);
        } else {
            if (!emitter.isFading())
                emitter.fade();
        }
    }

    // Any sounds left in the list are new and need
    // an emitter created.
    final TObjectFloatIterator<SoundEffect> newSounds = sounds.iterator();
    while (newSounds.hasNext()) {
        newSounds.advance();
        if (newSounds.value() > 0) {
            final SoundEffect effect = newSounds.key();
            this.emitters.put(effect, new PlayerEmitter(effect));
        }
    }
}
项目:easyrec_major    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:easyrec_major    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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 ) {
        logger.warn("An error occurred!", ex);
        // unused.
    }
    return true;
}
项目:recalot.com    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:recalot.com    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:easyrec-PoC    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:easyrec-PoC    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:easyrec    文件:TObjectFloatHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:easyrec    文件:TObjectFloatCustomHashMap.java   
/**
 * 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 TObjectFloatMap ) ) {
        return false;
    }
    TObjectFloatMap that = ( TObjectFloatMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TObjectFloatIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            Object key = iter.key();
            float 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;
}
项目:gitrec    文件:FilterItemItemLinksDetailed.java   
public DataBag getValue() {
    TObjectFloatIterator<String> it = inputItems.iterator();
    while (it.hasNext()) {
        it.advance();
        if (it.value() >= minLinkWeight) {
            outputItems.add(tf.newTupleNoCopy(
                    ImmutableList.of(it.key(), it.value(), inputSignals.get(it.key()))
            ));

        }
    }

    return outputItems;
}
项目:gitrec    文件:FilterItemItemLinks.java   
public DataBag getValue() {
    TObjectFloatIterator<String> it = inputItems.iterator();
    while (it.hasNext()) {
        it.advance();
        if (it.value() >= minLinkWeight) {
            outputItems.add(tf.newTupleNoCopy(
                ImmutableList.of(it.key(), it.value())
            ));
        }
    }

    return outputItems;
}
项目:xcc    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:xcc    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:HCFCore    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:HCFCore    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:HCFCore    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:HCFCore    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:trove-3.0.3    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
@Override
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator( this );
}
项目:trove-3.0.3    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
@Override
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator( this );
}
项目:easyrec_major    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:easyrec_major    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:recalot.com    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:recalot.com    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:easyrec-PoC    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:easyrec-PoC    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:pre-cu    文件:AutoDeltaObjectFloatMap.java   
public TObjectFloatIterator<K> iterator() {
    return container.iterator();
}
项目:pre-cu    文件:AutoDeltaStringFloatMap.java   
public TObjectFloatIterator<String> iterator() {
    return container.iterator();
}
项目:easyrec    文件:TObjectFloatHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}
项目:easyrec    文件:TObjectFloatCustomHashMap.java   
/**
 * @return an iterator over the entries in this map
 */
public TObjectFloatIterator<K> iterator() {
    return new TObjectFloatHashIterator<K>( this );
}