• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TObjectObjectProcedure类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: copyTo

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@NotNull
public KeymapImpl copyTo(@NotNull final KeymapImpl otherKeymap) {
  otherKeymap.myParent = myParent;
  otherKeymap.myName = myName;
  otherKeymap.myCanModify = canModify();

  otherKeymap.cleanShortcutsCache();

  otherKeymap.myActionId2ListOfShortcuts.clear();
  otherKeymap.myActionId2ListOfShortcuts.ensureCapacity(myActionId2ListOfShortcuts.size());
  myActionId2ListOfShortcuts.forEachEntry(new TObjectObjectProcedure<String, OrderedSet<Shortcut>>() {
    @Override
    public boolean execute(String actionId, OrderedSet<Shortcut> shortcuts) {
      otherKeymap.myActionId2ListOfShortcuts.put(actionId, new OrderedSet<Shortcut>(shortcuts));
      return true;
    }
  });
  return otherKeymap;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:KeymapImpl.java


示例2: apply

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@NotNull
public List<T> apply() {
  final List<T> items = getItems();
  if (!helper.hasModifiedItems()) {
    return items;
  }

  helper.process(new TObjectObjectProcedure<T, T>() {
    @Override
    public boolean execute(T newItem, T oldItem) {
      itemEditor.applyModifiedProperties(newItem, oldItem);
      silentlyReplaceItem(newItem, oldItem, -1);
      return true;
    }
  });

  helper.reset(items);
  return items;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ListModelEditorBase.java


示例3: selectItem

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public void selectItem(@NotNull final T item) {
  table.clearSelection();

  final Ref<T> ref;
  if (helper.hasModifiedItems()) {
    ref = Ref.create();
    helper.process(new TObjectObjectProcedure<T, T>() {
      @Override
      public boolean execute(T modified, T original) {
        if (item == original) {
          ref.set(modified);
        }
        return ref.isNull();
      }
    });
  }
  else {
    ref = null;
  }

  table.addSelection(ref == null || ref.isNull() ? item : ref.get());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TableModelEditor.java


示例4: mapCopy

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
private THashMap<Value, Object> mapCopy(final THashMap<Value, Object> map) {
  if (map == null) {
    return null;
  }
  final THashMap<Value, Object> cloned = map.clone();
  cloned.forEachEntry(new TObjectObjectProcedure<Value, Object>() {
    @Override
    public boolean execute(Value key, Object val) {
      if (val instanceof ChangeBufferingList) {
        cloned.put(key, ((ChangeBufferingList)val).clone());
      }
      return true;
    }
  });

  return cloned;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ValueContainerImpl.java


示例5: getState

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@Nullable
@Override
public State getState() {
  synchronized (myStatus) {
    // remove default entries
    myStatus.retainEntries(new TObjectObjectProcedure<VirtualFile, Entry>() {
      @Override
      public boolean execute(VirtualFile file, Entry entry) {
        return !(entry.status == Status.ACTIVE && entry.error == null);
      }
    });

    if (myStatus.isEmpty()) {
      return new State(Collections.<Entry>emptyList());
    }

    Entry[] entries = myStatus.values().toArray(new Entry[myStatus.size()]);
    Arrays.sort(entries);
    return new State(Arrays.asList(entries));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DslActivationStatus.java


示例6: mapCopy

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
private THashMap<Value, Object> mapCopy(final THashMap<Value, Object> map) {
  if (map == null) {
    return null;
  }
  final THashMap<Value, Object> cloned = map.clone();
  cloned.forEachEntry(new TObjectObjectProcedure<Value, Object>() {
    @Override
    public boolean execute(Value key, Object val) {
      if (val instanceof TIntHashSet) {
        cloned.put(key, ((TIntHashSet)val).clone());
      }
      return true;
    }
  });

  return cloned;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:ValueContainerImpl.java


示例7: selectItem

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public void selectItem(@Nonnull final T item) {
  table.clearSelection();

  final Ref<T> ref;
  if (helper.hasModifiedItems()) {
    ref = Ref.create();
    helper.process(new TObjectObjectProcedure<T, T>() {
      @Override
      public boolean execute(T modified, T original) {
        if (item == original) {
          ref.set(modified);
        }
        return ref.isNull();
      }
    });
  }
  else {
    ref = null;
  }

  table.addSelection(ref == null || ref.isNull() ? item : ref.get());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:TableModelEditor.java


示例8: processAllKeysAsDeleted

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
private void processAllKeysAsDeleted(final RemovedKeyProcessor<Key> removeProcessor) throws StorageException {
  if (myMap instanceof THashMap) {
    final StorageException[] exception = new StorageException[]{null};
    ((THashMap<Key, Value>)myMap).forEachEntry(new TObjectObjectProcedure<Key, Value>() {
      @Override
      public boolean execute(Key k, Value v) {
        try {
          removeProcessor.process(k, myInputId);
        }
        catch (StorageException e) {
          exception[0] = e;
          return false;
        }
        return true;
      }
    });
    if (exception[0] != null) throw exception[0];
  }
  else {
    for (Key key : myMap.keySet()) {
      removeProcessor.process(key, myInputId);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:MapInputDataDiffBuilder.java


示例9: putAll

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@Override
public void putAll(ObjectObjectMultiMaplet<K, V> m) {
  m.forEachEntry(new TObjectObjectProcedure<K, Collection<V>>() {
    @Override
    public boolean execute(K key, Collection<V> value) {
      put(key, value);
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ObjectObjectPersistentMultiMaplet.java


示例10: replaceAll

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@Override
public void replaceAll(ObjectObjectMultiMaplet<K, V> m) {
  m.forEachEntry(new TObjectObjectProcedure<K, Collection<V>>() {
    @Override
    public boolean execute(K key, Collection<V> value) {
      replace(key, value);
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ObjectObjectPersistentMultiMaplet.java


示例11: correctPasswords

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
private void correctPasswords(@NotNull HttpConfigurable to) {
  synchronized (myLock) {
    to.myGenericPasswords.retainEntries(new TObjectObjectProcedure<CommonProxy.HostInfo, ProxyInfo>() {
      @Override
      public boolean execute(CommonProxy.HostInfo hostInfo, ProxyInfo proxyInfo) {
        return proxyInfo.isStore();
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:HttpConfigurable.java


示例12: processModifiedItems

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public void processModifiedItems(@NotNull final PairProcessor<T, T> processor) {
  // don't want to expose TObjectObjectProcedure - avoid implementation details
  helper.process(new TObjectObjectProcedure<T, T>() {
    @Override
    public boolean execute(T newItem, T oldItem) {
      return processor.process(newItem, oldItem);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CollectionModelEditor.java


示例13: apply

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@NotNull
public List<T> apply() {
  if (helper.hasModifiedItems()) {
    @SuppressWarnings("unchecked")
    final ColumnInfo<T, Object>[] columns = model.getColumnInfos();
    helper.process(new TObjectObjectProcedure<T, T>() {
      @Override
      public boolean execute(T newItem, @NotNull T oldItem) {
        for (ColumnInfo<T, Object> column : columns) {
          if (column.isCellEditable(newItem)) {
            column.setValue(oldItem, column.valueOf(newItem));
          }
        }

        if (itemEditor instanceof DialogItemEditor) {
          ((DialogItemEditor<T>)itemEditor).applyEdited(oldItem, newItem);
        }

        model.items.set(ContainerUtil.indexOfIdentity(model.items, newItem), oldItem);
        return true;
      }
    });
  }

  helper.reset(model.items);
  return model.items;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:TableModelEditor.java


示例14: copy

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
@NotNull
public ValueContainerImpl<Value> copy() {
  ValueContainerImpl<Value> container = new ValueContainerImpl<Value>();

  if (myInputIdMapping instanceof THashMap) {
    final THashMap<Value, Object> mapping = (THashMap<Value, Object>)myInputIdMapping;
    final THashMap<Value, Object> newMapping = new THashMap<Value, Object>(mapping.size());
    container.myInputIdMapping = newMapping;

    mapping.forEachEntry(new TObjectObjectProcedure<Value, Object>() {
      @Override
      public boolean execute(Value key, Object val) {
        if (val instanceof ChangeBufferingList) {
          newMapping.put(key, ((ChangeBufferingList)val).clone());
        } else {
          newMapping.put(key, val);
        }
        return true;
      }
    });
  } else {
    container.myInputIdMapping = myInputIdMapping;
    container.myInputIdMappingValue = myInputIdMappingValue instanceof ChangeBufferingList ?
                                      ((ChangeBufferingList)myInputIdMappingValue).clone():
                                      myInputIdMappingValue;
  }
  return container;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ValueContainerImpl.java


示例15: iterateAddedKeyAndValues

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public static <Key, Value> void iterateAddedKeyAndValues(final int inputId,
                                                         final AddedKeyProcessor<Key, Value> consumer,
                                                         Map<Key, Value> data) throws StorageException {
  if (data instanceof THashMap) {
    // such map often (from IdIndex) contain 100x (avg ~240) of entries, also THashMap have no Entry inside so we optimize for gc too
    final Ref<StorageException> exceptionRef = new Ref<StorageException>();
    final boolean b = ((THashMap<Key, Value>)data).forEachEntry(new TObjectObjectProcedure<Key, Value>() {
      @Override
      public boolean execute(Key key, Value value) {
        try {
          consumer.process(key, value, inputId);
        }
        catch (StorageException ex) {
          exceptionRef.set(ex);
          return false;
        }
        return true;
      }
    });
    if (!b) throw exceptionRef.get();
  }
  else {
    for (Map.Entry<Key, Value> entry : data.entrySet()) {
      consumer.process(entry.getKey(), entry.getValue(), inputId);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:MapDiffUpdateData.java


示例16: toString

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
/**
* @param valueThreshold
* @param sep Array with at least 2 Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default). 
* If 4 Strings are specified, the first pair will be used for the outer display, and the second pair for the inner display (of the contained {@link IntCounter}s).  
* @return A string representation of all (key, value) pairs such that the value equals or exceeds the given threshold
*/
  public String toString(final int valueThreshold, String[] sep) {
  	String entrySep = ",";	// default
String kvSep = "=";	// default
if (sep!=null && sep.length>0) {
	if (sep[0]!=null) 
		entrySep = sep[0];
	if (sep.length>1 && sep[1]!=null)
		kvSep = sep[1];
}
final String ENTRYSEP = entrySep;
final String KVSEP = kvSep;
final String[] INNER_SEPS = new String[2];
if (sep.length==4) {
	INNER_SEPS[0] = sep[2];
	INNER_SEPS[1] = sep[3];
}
else {
	INNER_SEPS[0] = ENTRYSEP;
	INNER_SEPS[1] = KVSEP;
}
      final StringBuilder buf = new StringBuilder("{");
      this.forEachEntry(new TObjectObjectProcedure<K,IntCounter<L>>() {
          private boolean first = true;
          public boolean execute(K key, IntCounter<L> value) {
          	if ( first ) first = false;
           else buf.append(ENTRYSEP);
          	
           buf.append(key);
           buf.append(KVSEP);
           buf.append(value.toString(valueThreshold, INNER_SEPS));
          	return true;
          }
      });
      buf.append("}");
      return buf.toString();
  }
 
开发者ID:Noahs-ARK,项目名称:semafor-semantic-parser,代码行数:43,代码来源:IntCounterMap.java


示例17: toString

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
/**
* @param valueThreshold
* @param sep Array with at least 2 Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default). 
* If 4 Strings are specified, the first pair will be used for the outer display, and the second pair for the inner display (of the contained {@link IntCounter}s).  
* @return A string representation of all (key, value) pairs such that the value equals or exceeds the given threshold
*/
  public String toString(final double valueThreshold, String[] sep) {
  	String entrySep = ",";	// default
String kvSep = "=";	// default
if (sep!=null && sep.length>0) {
	if (sep[0]!=null) 
		entrySep = sep[0];
	if (sep.length>1 && sep[1]!=null)
		kvSep = sep[1];
}
final String ENTRYSEP = entrySep;
final String KVSEP = kvSep;
final String[] INNER_SEPS = new String[2];
if (sep.length==4) {
	INNER_SEPS[0] = sep[2];
	INNER_SEPS[1] = sep[3];
}
else {
	INNER_SEPS[0] = ENTRYSEP;
	INNER_SEPS[1] = KVSEP;
}
      final StringBuilder buf = new StringBuilder("{");
      this.forEachEntry(new TObjectObjectProcedure<K,Counter<L>>() {
          private boolean first = true;
          public boolean execute(K key, Counter<L> value) {
          	if ( first ) first = false;
           else buf.append(ENTRYSEP);
          	
           buf.append(key);
           buf.append(KVSEP);
           buf.append(value.toString(valueThreshold, INNER_SEPS));
          	return true;
          }
      });
      buf.append("}");
      return buf.toString();
  }
 
开发者ID:Noahs-ARK,项目名称:semafor-semantic-parser,代码行数:43,代码来源:CounterMap.java


示例18: copy

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public ValueContainerImpl<Value> copy() {
  ValueContainerImpl<Value> container = new ValueContainerImpl<Value>();

  if (myInputIdMapping instanceof THashMap) {
    final THashMap<Value, Object> mapping = (THashMap<Value, Object>)myInputIdMapping;
    final THashMap<Value, Object> newMapping = new THashMap<Value, Object>(mapping.size());
    container.myInputIdMapping = newMapping;

    mapping.forEachEntry(new TObjectObjectProcedure<Value, Object>() {
      @Override
      public boolean execute(Value key, Object val) {
        if (val instanceof TIntHashSet) {
          newMapping.put(key, ((TIntHashSet)val).clone());
        }
        else {
          newMapping.put(key, val);
        }
        return true;
      }
    });
  } else {
    container.myInputIdMapping = myInputIdMapping;
    container.myInputIdMappingValue = myInputIdMappingValue instanceof TIntHashSet ?
                                      ((TIntHashSet)myInputIdMappingValue).clone():myInputIdMappingValue;
  }
  return container;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:ValueContainerImpl.java


示例19: correctPasswords

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
private void correctPasswords(@Nonnull HttpConfigurable to) {
  synchronized (myLock) {
    to.myGenericPasswords.retainEntries(new TObjectObjectProcedure<CommonProxy.HostInfo, ProxyInfo>() {
      @Override
      public boolean execute(CommonProxy.HostInfo hostInfo, ProxyInfo proxyInfo) {
        return proxyInfo.isStore();
      }
    });
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:HttpConfigurable.java


示例20: processModifiedItems

import gnu.trove.TObjectObjectProcedure; //导入依赖的package包/类
public void processModifiedItems(@Nonnull final PairProcessor<T, T> processor) {
  // don't want to expose TObjectObjectProcedure - avoid implementation details
  helper.process(new TObjectObjectProcedure<T, T>() {
    @Override
    public boolean execute(T newItem, T oldItem) {
      return processor.process(newItem, oldItem);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:CollectionModelEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OnDiskAtom类代码示例发布时间:2022-05-22
下一篇:
Java CsrfException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap