本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例8: putAll
import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TByteObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例9: putAll
import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void putAll( TByteObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例10: putAll
import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TByteObjectMap<V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例11: getMap
import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public TByteObjectMap<V> getMap() {
return container;
}
示例12: getMap
import gnu.trove.map.TByteObjectMap; //导入依赖的package包/类
public TByteObjectMap<String> getMap() {
return container;
}
示例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 );
}
示例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;
}
示例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;
}