本文整理汇总了Java中gnu.trove.map.TCharObjectMap类的典型用法代码示例。如果您正苦于以下问题:Java TCharObjectMap类的具体用法?Java TCharObjectMap怎么用?Java TCharObjectMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TCharObjectMap类属于gnu.trove.map包,在下文中一共展示了TCharObjectMap类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CompiledShape
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
public CompiledShape( TCharObjectMap<ItemStack> match, String... lines ) {
match.putIfAbsent( '0', null );
char[][] array = new char[ lines.length ][];
int lastLength = -1;
for( int i = 0; i < lines.length; i++ ) {
array[ i ] = lines[ i ].toCharArray();
if( lastLength != -1 && lastLength != lines[ i ].length() ) {
throw new IllegalArgumentException( "Not equal length of lines" );
}
lastLength = lines[ i ].length();
for( char c : lines[ i ].toCharArray() ) {
if( !match.containsKey( c ) ) {
throw new IllegalArgumentException( "Invalid char " + c );
}
}
}
this.shape = new ItemStack[ array.length ][];
for( int i = 0; i < array.length; i++ ) {
char[] b = array[ i ];
ItemStack[] r = new ItemStack[ b.length ];
for( int k = 0; k < r.length; k++ ) {
r[ k ] = match.get( b[ k ] );
}
shape[ i ] = r;
}
}
开发者ID:lukas81298,项目名称:FlexMC,代码行数:27,代码来源:CompiledShape.java
示例2: equals
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean equals( Object other ) {
if ( ! ( other instanceof TCharObjectMap ) ) {
return false;
}
TCharObjectMap that = ( TCharObjectMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TCharObjectIterator iter = this.iterator();
while ( iter.hasNext() ) {
iter.advance();
char 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,代码来源:TCharObjectHashMap.java
示例3: readExternal
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// MAP
//noinspection unchecked
_map = ( TCharObjectMap<V> ) in.readObject();
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TCharObjectMapDecorator.java
示例4: equals
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("rawtypes")
public boolean equals( Object other ) {
if ( ! ( other instanceof TCharObjectMap ) ) {
return false;
}
TCharObjectMap that = ( TCharObjectMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TCharObjectIterator iter = this.iterator();
while ( iter.hasNext() ) {
iter.advance();
char 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,代码来源:TCharObjectHashMap.java
示例5: readExternal
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// MAP
//noinspection unchecked
_map = ( TCharObjectMap<V> ) in.readObject();
}
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:13,代码来源:TCharObjectMapDecorator.java
示例6: putAll
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TCharObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TCharObjectHashMap.java
示例7: putAll
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void putAll( TCharObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:6,代码来源:TCharObjectHashMap.java
示例8: putAll
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TCharObjectMap<V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
开发者ID:major2015,项目名称:easyrec_major,代码行数:5,代码来源:TCharObjectHashMap.java
示例9: TCharObjectHashMap
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/**
* Creates a new <code>TCharObjectHashMap</code> that contains the entries
* in the map passed to it.
*
* @param map the <tt>TCharObjectMap</tt> to be copied.
*/
public TCharObjectHashMap( TCharObjectMap<? extends V> map ) {
this( map.size(), 0.5f, map.getNoEntryKey() );
putAll( map );
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TCharObjectHashMap.java
示例10: TCharObjectMapDecorator
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/**
* Creates a wrapper that decorates the specified primitive map.
*
* @param map the <tt>TCharObjectMap</tt> to wrap.
*/
public TCharObjectMapDecorator( TCharObjectMap<V> map ) {
super();
this._map = map;
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TCharObjectMapDecorator.java
示例11: getMap
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
/**
* Returns a reference to the map wrapped by this decorator.
*
* @return the wrapped <tt>TCharObjectMap</tt> instance.
*/
public TCharObjectMap<V> getMap() {
return _map;
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:TCharObjectMapDecorator.java
示例12: putAll
import gnu.trove.map.TCharObjectMap; //导入依赖的package包/类
@Override
public void putAll(TCharObjectMap map) {
}
开发者ID:ankushs92,项目名称:Browscap4j,代码行数:5,代码来源:TCharObjectSinglentonMap.java
注:本文中的gnu.trove.map.TCharObjectMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论