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


Java TByteObjectMap类代码示例

本文整理汇总了Java中gnu.trove.map.TByteObjectMap的典型用法代码示例。如果您正苦于以下问题:Java TByteObjectMap类的具体用法?Java TByteObjectMap怎么用?Java TByteObjectMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getChunkAt

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public ChunkColumn getChunkAt( int x, int z ) {
    this.chunkLock.readLock().lock();
    try {
        int i = x / 16;
        if ( x < 0 ) {
            i--;
        }
        int j = z / 16;
        if ( z < 0 ) {
            j--;
        }
        TByteObjectMap<ChunkColumn> map = this.columns.get( (byte) i );
        if ( map == null ) {
            return null;
        }
        return map.get( (byte) j );
    } finally {
        this.chunkLock.readLock().unlock();
    }
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:21,代码来源:FlexWorld.java

示例2: generateColumn

import gnu.trove.map.TByteObjectMap; //导入依赖的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();
    }
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:19,代码来源:FlexWorld.java

示例3: getColumns

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public List<ChunkColumn> getColumns() {
    List<ChunkColumn> list = new ArrayList<>();
    this.chunkLock.readLock().lock();
    try {
        this.columns.forEachValue( new TObjectProcedure<TByteObjectMap<ChunkColumn>>() {
            @Override
            public boolean execute( TByteObjectMap<ChunkColumn> value ) {
                list.addAll( value.valueCollection() );
                return true;
            }
        } );
    } finally {
        this.chunkLock.readLock().unlock();
    }
    return list;
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:17,代码来源:FlexWorld.java

示例4: equals

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@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;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:31,代码来源:TByteObjectHashMap.java

示例5: readExternal

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    //noinspection unchecked
    _map = ( TByteObjectMap<V> ) in.readObject();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TByteObjectMapDecorator.java

示例6: equals

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("rawtypes")
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;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:33,代码来源:TByteObjectHashMap.java

示例7: readExternal

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    //noinspection unchecked
    _map = ( TByteObjectMap<V> ) in.readObject();
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:13,代码来源:TByteObjectMapDecorator.java

示例8: putAll

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TByteObjectMap<? extends V> map ){
    map.forEachEntry( PUT_ALL_PROC );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TByteObjectHashMap.java

示例9: putAll

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void putAll( TByteObjectMap<? extends V> map ){
    map.forEachEntry( PUT_ALL_PROC );
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:6,代码来源:TByteObjectHashMap.java

示例10: putAll

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TByteObjectMap<V> map ){
    map.forEachEntry( PUT_ALL_PROC );
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:5,代码来源:TByteObjectHashMap.java

示例11: getMap

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public TByteObjectMap<V> getMap() {
    return container;
}
 
开发者ID:bacta,项目名称:pre-cu,代码行数:4,代码来源:AutoDeltaBoolObjectMap.java

示例12: getMap

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public TByteObjectMap<String> getMap() {
    return container;
}
 
开发者ID:bacta,项目名称:pre-cu,代码行数:4,代码来源:AutoDeltaBoolStringMap.java

示例13: TByteObjectHashMap

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/**
 * 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 );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TByteObjectHashMap.java

示例14: TByteObjectMapDecorator

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/**
 * Creates a wrapper that decorates the specified primitive map.
 *
 * @param map the <tt>TByteObjectMap</tt> to wrap.
 */
public TByteObjectMapDecorator( TByteObjectMap<V> map ) {
    super();
    this._map = map;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TByteObjectMapDecorator.java

示例15: getMap

import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/**
 * Returns a reference to the map wrapped by this decorator.
 *
 * @return the wrapped <tt>TByteObjectMap</tt> instance.
 */
public TByteObjectMap<V> getMap() {
    return _map;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:TByteObjectMapDecorator.java


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