本文整理汇总了Java中gnu.trove.map.hash.TByteObjectHashMap类的典型用法代码示例。如果您正苦于以下问题:Java TByteObjectHashMap类的具体用法?Java TByteObjectHashMap怎么用?Java TByteObjectHashMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TByteObjectHashMap类属于gnu.trove.map.hash包,在下文中一共展示了TByteObjectHashMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateColumn
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
private void generateColumn( int x, int z ) {
this.chunkLock.writeLock().lock();
try {
ChunkColumn chunkColumnColumn = new ChunkColumn( x, z, this );
for ( int i = 0; i < chunkColumnColumn.getSections().length; i++ ) {
ChunkSection section = new ChunkSection( chunkColumnColumn );
chunkColumnColumn.getSections()[i] = section;
}
this.generator.generate( chunkColumnColumn );
TByteObjectMap<ChunkColumn> c = this.columns.get( (byte) x );
if ( c == null ) {
this.columns.put( (byte) x, c = new TByteObjectHashMap<>() );
}
c.put( (byte) z, chunkColumnColumn );
} finally {
this.chunkLock.writeLock().unlock();
}
}
示例2: register
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T extends Message, U extends MessageHandler<T>> void register(Addon addon, Class<T> message, Class<U> handler) {
if (locked) {
throw new IllegalStateException(addon.getDescription().getName() + " attempted to register a message after INITIALIZE phase! This is NOT ALLOWED.");
}
final TByteObjectHashMap<Class<? extends Message>> discriminators;
try {
discriminatorsField.setAccessible(true);
discriminators = (TByteObjectHashMap<Class<? extends Message>>) discriminatorsField.get(this);
discriminatorsField.setAccessible(false);
} catch (IllegalAccessException e) {
game.getLogger().info("Encountered fatal exception when " + addon.getDescription().getName() + " attempted to register [" + message.getSimpleName() + "]", e);
return;
}
if (discriminators.containsValue(message)) {
game.getLogger().warn(addon.getDescription().getName() + " attempted to register [" + message + "] twice!");
return;
}
addDiscriminator(discriminators.size() == 0 ? 0 : discriminators.size() + 1, message);
if (handler != null) {
handlers.put(message, handler);
game.getLogger().info(addon.getDescription().getName() + " has registered message [" + message.getSimpleName() + "] with handler [" + handler.getSimpleName() + "] in the pipeline");
} else {
game.getLogger().info(addon.getDescription().getName() + " has registered message [" + message.getSimpleName() + "] with no handler in the pipeline");
}
}
示例3: TroveByteIndexedCollection
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
/**
* Constructor which specifies the index's key.
*
* @param keyDefinition
* the {@code IndexKeyDefinition} to be used
*/
public TroveByteIndexedCollection(final IndexKeyDefinition keyDefinition) {
super(keyDefinition);
if (!keyDefinition.isSingleTypedKey(Byte.class)) {
throw new IllegalArgumentException("The key must be a single Byte");
}
troveMap = new TByteObjectHashMap<Object>();
}
示例4: AutoDeltaBoolObjectMap
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
public AutoDeltaBoolObjectMap(Function<ByteBuffer, V> valueCreator) {
this.changes = new ArrayList<>(5);
this.container = new TByteObjectHashMap<>();
this.baselineCommandCount = 0;
this.valueCreator = valueCreator;
}
示例5: AutoDeltaBoolStringMap
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
public AutoDeltaBoolStringMap() {
this.changes = new ArrayList<>(5);
this.container = new TByteObjectHashMap<>();
this.baselineCommandCount = 0;
}
示例6: AutoDeltaByteObjectMap
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
public AutoDeltaByteObjectMap(Function<ByteBuffer, V> valueCreator) {
this.changes = new ArrayList<>(5);
this.container = new TByteObjectHashMap<>();
this.baselineCommandCount = 0;
this.valueCreator = valueCreator;
}
示例7: AutoDeltaByteStringMap
import gnu.trove.map.hash.TByteObjectHashMap; //导入依赖的package包/类
public AutoDeltaByteStringMap() {
this.changes = new ArrayList<>(5);
this.container = new TByteObjectHashMap<>();
this.baselineCommandCount = 0;
}