本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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");
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
});
}
}
示例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;
}
示例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);
}
示例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();
}
}
}
示例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;
}
示例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;
}