本文整理汇总了Java中gnu.trove.map.TShortObjectMap类的典型用法代码示例。如果您正苦于以下问题:Java TShortObjectMap类的具体用法?Java TShortObjectMap怎么用?Java TShortObjectMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TShortObjectMap类属于gnu.trove.map包,在下文中一共展示了TShortObjectMap类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean equals( Object other ) {
if ( ! ( other instanceof TShortObjectMap ) ) {
return false;
}
TShortObjectMap that = ( TShortObjectMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TShortObjectIterator iter = this.iterator();
while ( iter.hasNext() ) {
iter.advance();
short 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;
}
示例2: readExternal
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// MAP
//noinspection unchecked
_map = ( TShortObjectMap<V> ) in.readObject();
}
示例3: equals
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("rawtypes")
public boolean equals( Object other ) {
if ( ! ( other instanceof TShortObjectMap ) ) {
return false;
}
TShortObjectMap that = ( TShortObjectMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TShortObjectIterator iter = this.iterator();
while ( iter.hasNext() ) {
iter.advance();
short 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;
}
示例4: readExternal
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// MAP
//noinspection unchecked
_map = ( TShortObjectMap<V> ) in.readObject();
}
示例5: putAll
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TShortObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例6: putAll
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void putAll( TShortObjectMap<? extends V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例7: putAll
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/** {@inheritDoc} */
public void putAll( TShortObjectMap<V> map ){
map.forEachEntry( PUT_ALL_PROC );
}
示例8: getMap
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
public TShortObjectMap<V> getMap() {
return container;
}
示例9: getMap
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
public TShortObjectMap<String> getMap() {
return container;
}
示例10: TShortObjectHashMap
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/**
* Creates a new <code>TShortObjectHashMap</code> that contains the entries
* in the map passed to it.
*
* @param map the <tt>TShortObjectMap</tt> to be copied.
*/
public TShortObjectHashMap( TShortObjectMap<? extends V> map ) {
this( map.size(), 0.5f, map.getNoEntryKey() );
putAll( map );
}
示例11: TShortObjectMapDecorator
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/**
* Creates a wrapper that decorates the specified primitive map.
*
* @param map the <tt>TShortObjectMap</tt> to wrap.
*/
public TShortObjectMapDecorator( TShortObjectMap<V> map ) {
super();
this._map = map;
}
示例12: getMap
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/**
* Returns a reference to the map wrapped by this decorator.
*
* @return the wrapped <tt>TShortObjectMap</tt> instance.
*/
public TShortObjectMap<V> getMap() {
return _map;
}
示例13: TShortObjectHashMap
import gnu.trove.map.TShortObjectMap; //导入依赖的package包/类
/**
* Creates a new <code>TShortObjectHashMap</code> that contains the entries
* in the map passed to it.
*
* @param map the <tt>TShortObjectMap</tt> to be copied.
*/
public TShortObjectHashMap( TShortObjectMap<V> map ) {
this( map.size(), 0.5f, map.getNoEntryKey() );
putAll( map );
}