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


Java TObjectObjectProcedure类代码示例

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


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


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