当前位置: 首页>>代码示例>>Java>>正文


Java TObjectFloatIterator.key方法代码示例

本文整理汇总了Java中gnu.trove.iterator.TObjectFloatIterator.key方法的典型用法代码示例。如果您正苦于以下问题:Java TObjectFloatIterator.key方法的具体用法?Java TObjectFloatIterator.key怎么用?Java TObjectFloatIterator.key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.iterator.TObjectFloatIterator的用法示例。


在下文中一共展示了TObjectFloatIterator.key方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findNewTarget

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
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);
}
 
开发者ID:bacta,项目名称:pre-cu,代码行数:23,代码来源:HateList.java

示例2: equals

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:39,代码来源:TObjectFloatHashMap.java

示例3: equals

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:41,代码来源:TObjectFloatHashMap.java

示例4: queueAmbientSounds

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
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));
		}
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:38,代码来源:SoundEffectHandler.java

示例5: equals

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:37,代码来源:TObjectFloatHashMap.java

示例6: equals

import gnu.trove.iterator.TObjectFloatIterator; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:38,代码来源:TObjectFloatCustomHashMap.java


注:本文中的gnu.trove.iterator.TObjectFloatIterator.key方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。