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