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


Java TIntObjectProcedure类代码示例

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


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

示例1: retainEntries

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings({"unchecked"})
public boolean retainEntries( TIntObjectProcedure<? super V> procedure ) {
    boolean modified = false;
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;

    // Temporarily disable compaction. This is a fix for bug #1738760
    tempDisableAutoCompaction();
    try {
        for ( int i = keys.length; i-- > 0; ) {
            if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
                removeAt( i );
                modified = true;
            }
        }
    }
    finally {
        reenableAutoCompaction( true );
    }

    return modified;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:25,代码来源:TIntObjectHashMap.java

示例2: toString

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
public String toString() {
    final StringBuilder buf = new StringBuilder("{");
    forEachEntry(new TIntObjectProcedure<V>() {
        private boolean first = true;
        public boolean execute(int key, Object value) {
            if ( first ) first = false;
            else buf.append( "," );

            buf.append(key);
            buf.append("=");
            buf.append(value);
            return true;
        }
    });
    buf.append("}");
    return buf.toString();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:18,代码来源:TIntObjectHashMap.java

示例3: retainEntries

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public boolean retainEntries( TIntObjectProcedure<? super V> procedure ) {
    boolean modified = false;
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;

    // Temporarily disable compaction. This is a fix for bug #1738760
    tempDisableAutoCompaction();
    try {
        for ( int i = keys.length; i-- > 0; ) {
            if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
                removeAt( i );
                modified = true;
            }
        }
    }
    finally {
        reenableAutoCompaction( true );
    }

    return modified;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:24,代码来源:TIntObjectHashMap.java

示例4: retainEntries

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean retainEntries( TIntObjectProcedure<? super V> procedure ) {
    boolean modified = false;
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;

    // Temporarily disable compaction. This is a fix for bug #1738760
    tempDisableAutoCompaction();
    try {
        for ( int i = keys.length; i-- > 0; ) {
            if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
                removeAt( i );
                modified = true;
            }
        }
    }
    finally {
        reenableAutoCompaction( true );
    }

    return modified;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:25,代码来源:TIntObjectHashMap.java

示例5: toString

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
@Override
public String toString() {
    final StringBuilder buf = new StringBuilder("{");
    forEachEntry(new TIntObjectProcedure<V>() {
        private boolean first = true;
        @Override
        public boolean execute(int key, Object value) {
            if ( first ) first = false;
            else buf.append( "," );

            buf.append(key);
            buf.append("=");
            buf.append(value);
            return true;
        }
    });
    buf.append("}");
    return buf.toString();
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TIntObjectHashMap.java

示例6: init

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
public void init(){
    handlerMap = new HashMap<>();
    TIntObjectHashMap<Class<?>> netEventHandlerClassMap = ServiceHelper.getNetEventListenerHandlerClassMap();
    netEventHandlerClassMap.forEachEntry(new TIntObjectProcedure<Class<?>>() {
        @Override
        public boolean execute(int i, Class<?> aClass) {
            handlerMap.put(i, (NetEventListenerHandler) BeanHelper.getServiceBean(aClass));
            return true;
        }
    });

    selfAdd = Util.getHostAddress()+":"+Server.getEngineConfigure().getNetEventPort();


    monitorService = BeanHelper.getServiceBean(MonitorService.class);
    eventService = BeanHelper.getServiceBean(EventService.class);
    monitorService.addStartCondition(SysConstantDefine.NetEventServiceStart,
            "wait for netEvent start and connect mainServer");
}
 
开发者ID:xuerong,项目名称:MMServerEngine,代码行数:20,代码来源:NetEventService.java

示例7: getTopKBounds

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
public final TIntIntMap getTopKBounds() {
	final TIntIntMap output = new TIntIntHashMap(this.topK.size());
	this.topK.forEachEntry(new TIntObjectProcedure<PatternWithFreq[]>() {

		@Override
		public boolean execute(int k, PatternWithFreq[] v) {
			int s;
			PatternWithFreq p = v[v.length - 1];
			if (p == null) {
				s = -1;
			} else if (p.isClosed()) {
				s = p.getSupportCount() + 1;
			} else {
				s = p.getSupportCount();
			}
			output.put(k, s);
			return true;
		}
	});
	return output;
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:22,代码来源:PerItemTopKCollector.java

示例8: toString

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
@Override
public String toString() {
	final StringBuilder sb = new StringBuilder();
	this.topK.forEachEntry(new TIntObjectProcedure<PatternWithFreq[]>() {

		public boolean execute(int key, PatternWithFreq[] value) {
			sb.append("item " + key + " patterns");
			for (int i = 0; i < value.length; i++) {
				if (value[i] == null) {
					break;
				} else {
					sb.append(" " + value[i]);
				}
			}
			sb.append("\n");
			return true;
		}
	});
	return sb.toString();
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:21,代码来源:PerItemTopKCollector.java

示例9: retainEntries

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings({"unchecked"})
public boolean retainEntries( TIntObjectProcedure<V> procedure ) {
    boolean modified = false;
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;

    // Temporarily disable compaction. This is a fix for bug #1738760
    tempDisableAutoCompaction();
    try {
        for ( int i = keys.length; i-- > 0; ) {
            if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
                removeAt( i );
                modified = true;
            }
        }
    }
    finally {
        reenableAutoCompaction( true );
    }

    return modified;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:25,代码来源:TIntObjectHashMap.java

示例10: removeOldPendingRemoteCommands

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/**
 * Removes the pending remotely executed commands for which a result hasn't been sent since
 * {@link GlobalSettings#remoteCommandsTimeout} milliseconds
 */
public static void removeOldPendingRemoteCommands() {
	if (Minecraft.getMinecraft().world == null) return;
	final long currentTime = System.currentTimeMillis();
	
	synchronized (pendingRemoteCommands) {
		pendingRemoteCommands.retainEntries(new TIntObjectProcedure<PendingRemoteCommand>() {
			@Override
			public boolean execute(int a, PendingRemoteCommand b) {
				if (currentTime - b.startTime > MoreCommandsConfig.remoteCommandsTimeout) {
					b.callback.timeout();
					return false;
				}
				
				return true;
			}
		});
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:23,代码来源:PacketHandlerClient.java

示例11: equals

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
@Override
public boolean equals(Object other){
	if(!(other instanceof LanguageModel)) return false;
	final LanguageModel that = (LanguageModel) other;

	boolean equal = true;
	equal = Arrays.deepEquals(this.naiveBayesClasses, that.naiveBayesClasses); if(!equal) return false;
	equal = this.naiveBayesNFeats == that.naiveBayesNFeats; if(!equal) return false;
	equal = Arrays.deepEquals(MatrixUtils.mtjToDoubleArray(this.naiveBayesPC),MatrixUtils.mtjToDoubleArray(that.naiveBayesPC)); if(!equal) return false;
	equal = Arrays.deepEquals(MatrixUtils.mtjToDoubleArray(this.naiveBayesPTC),MatrixUtils.mtjToDoubleArray(that.naiveBayesPTC)); if(!equal) return false;
	equal = Arrays.equals(this.tk_nextmove,that.tk_nextmove); if(!equal) return false;
	equal = this.tk_output.forEachEntry(new TIntObjectProcedure<int[]>() {

		@Override
		public boolean execute(int key, int[] value) {
			return Arrays.equals(value, that.tk_output.get(key));
		}
	});if(!equal) return false;
	return equal;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:21,代码来源:LanguageModel.java

示例12: addSpotsToMemory

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/**
 * Add all the true-positives to memory as a new results set
 * 
 * @param filterResults
 */
void addSpotsToMemory(TIntObjectHashMap<FilterResult> filterResults)
{
	final MemoryPeakResults results = new MemoryPeakResults();
	results.setName(TITLE + " TP " + id++);
	filterResults.forEachEntry(new TIntObjectProcedure<FilterResult>()
	{
		public boolean execute(int peak, FilterResult filterResult)
		{
			for (ScoredSpot spot : filterResult.spots)
			{
				if (spot.match)
				{
					final float[] params = new float[] { 0, spot.getIntensity(), 0, spot.spot.x, spot.spot.y, 0,
							0 };
					results.add(peak, spot.spot.x, spot.spot.y, spot.getIntensity(), 0d, 0f, params, null);
				}
			}
			return true;
		}
	});
	MemoryPeakResults.addResults(results);
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:28,代码来源:BenchmarkSpotFilter.java

示例13: deleteByGlobalId

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
public static void deleteByGlobalId(final ODLDatastore<? extends ODLTable> ds, boolean useTransaction, long...ids){
	if(useTransaction){
		ds.startTransaction();
	}
	
	try {
		// split by table id
		TIntObjectMap<TLongArrayList> byTable =splitGlobalIdsByTable(ids);
		byTable.forEachEntry(new TIntObjectProcedure<TLongArrayList>() {

			@Override
			public boolean execute(int tableId, TLongArrayList rowIds) {
				ODLTable table = ds.getTableByImmutableId(tableId);
				if(table!=null){
					deleteById(table, rowIds.toArray());
				}
				return true;
			}
		});
	}finally{
		if(useTransaction){
			ds.endTransaction();				
		}
	}
}
 
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:26,代码来源:TableUtils.java

示例14: forEachEntry

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings({"unchecked"})
public boolean forEachEntry( TIntObjectProcedure<? super V> procedure ) {
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;
    for (int i = keys.length; i-- > 0;) {
        if (states[i] == FULL && ! procedure.execute(keys[i],values[i])) {
            return false;
        }
    }
    return true;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:14,代码来源:TIntObjectHashMap.java

示例15: forEachEntry

import gnu.trove.procedure.TIntObjectProcedure; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public boolean forEachEntry( TIntObjectProcedure<? super V> procedure ) {
    byte[] states = _states;
    int[] keys = _set;
    V[] values = _values;
    for (int i = keys.length; i-- > 0;) {
        if (states[i] == FULL && ! procedure.execute(keys[i],values[i])) {
            return false;
        }
    }
    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:13,代码来源:TIntObjectHashMap.java


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