Java 类gnu.trove.map.hash.TByteObjectHashMap 实例源码

项目:FlexMC    文件:FlexWorld.java   
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();
    }
}
项目:Obsidian    文件:CommonMessagePipeline.java   
@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");
    }
}
项目:dis-timeintervaldataanalyzer    文件:TroveByteIndexedCollection.java   
/**
 * 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>();
}
项目:pre-cu    文件:AutoDeltaBoolObjectMap.java   
public AutoDeltaBoolObjectMap(Function<ByteBuffer, V> valueCreator) {
    this.changes = new ArrayList<>(5);
    this.container = new TByteObjectHashMap<>();
    this.baselineCommandCount = 0;
    this.valueCreator = valueCreator;
}
项目:pre-cu    文件:AutoDeltaBoolStringMap.java   
public AutoDeltaBoolStringMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TByteObjectHashMap<>();
    this.baselineCommandCount = 0;
}
项目:pre-cu    文件:AutoDeltaByteObjectMap.java   
public AutoDeltaByteObjectMap(Function<ByteBuffer, V> valueCreator) {
    this.changes = new ArrayList<>(5);
    this.container = new TByteObjectHashMap<>();
    this.baselineCommandCount = 0;
    this.valueCreator = valueCreator;
}
项目:pre-cu    文件:AutoDeltaByteStringMap.java   
public AutoDeltaByteStringMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TByteObjectHashMap<>();
    this.baselineCommandCount = 0;
}