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


Java ImmutableMap.copyOf方法代码示例

本文整理汇总了Java中com.google.common.collect.ImmutableMap.copyOf方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableMap.copyOf方法的具体用法?Java ImmutableMap.copyOf怎么用?Java ImmutableMap.copyOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.ImmutableMap的用法示例。


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

示例1: ScoreKBPAgainstERE

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
@Inject
ScoreKBPAgainstERE(
    final Parameters params,
    final Map<String, ScoringEventObserver<DocLevelEventArg, DocLevelEventArg>> scoringEventObservers,
    final ResponsesAndLinkingFromEREExtractor responsesAndLinkingFromEREExtractor,
    ResponsesAndLinkingFromKBPExtractorFactory responsesAndLinkingFromKBPExtractorFactory,
    @DocIDsToScoreP Set<Symbol> docIdsToScore,
    @KeyFileMapP Map<Symbol, File> keyFilesMap,
    Predicate<DocLevelEventArg> inScopePredicate,
    @PermitMissingSystemDocsP boolean permitMissingSystemDocuments) {
  this.params = checkNotNull(params);
  // we use a sorted map because the binding of plugins may be non-deterministic
  this.scoringEventObservers = ImmutableSortedMap.copyOf(scoringEventObservers);
  this.responsesAndLinkingFromEREExtractor = checkNotNull(responsesAndLinkingFromEREExtractor);
  this.responsesAndLinkingFromKBPExtractorFactory = responsesAndLinkingFromKBPExtractorFactory;
  this.docIDsToScore = ImmutableSet.copyOf(docIdsToScore);
  this.goldDocIDToFileMap = ImmutableMap.copyOf(keyFilesMap);
  this.inScopePredicate = inScopePredicate;
  this.permitMissingSystemDocuments = permitMissingSystemDocuments;
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:21,代码来源:ScoreKBPAgainstERE.java

示例2: getClassPathEntries

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
@VisibleForTesting
static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
  LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
  // Search parent first, since it's the order ClassLoader#loadClass() uses.
  ClassLoader parent = classloader.getParent();
  if (parent != null) {
    entries.putAll(getClassPathEntries(parent));
  }
  if (classloader instanceof URLClassLoader) {
    URLClassLoader urlClassLoader = (URLClassLoader) classloader;
    for (URL entry : urlClassLoader.getURLs()) {
      if (entry.getProtocol().equals("file")) {
        File file = toFile(entry);
        if (!entries.containsKey(file)) {
          entries.put(file, classloader);
        }
      }
    }
  }
  return ImmutableMap.copyOf(entries);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:22,代码来源:ClassPath.java

示例3: MethodMetadata

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public MethodMetadata(
        String name,
        List<ParameterMetadata> parameters,
        ThriftCodec<Object> resultCodec,
        Map<Short, ThriftCodec<Object>> exceptionCodecs,
        boolean oneway)
{
    this.name = requireNonNull(name, "name is null");
    this.parameters = ImmutableList.copyOf(requireNonNull(parameters, "parameters is null"));
    this.resultCodec = requireNonNull(resultCodec, "resultCodec is null");
    this.exceptionCodecs = ImmutableMap.copyOf(requireNonNull(exceptionCodecs, "exceptionCodecs is null"));
    this.oneway = oneway;
}
 
开发者ID:airlift,项目名称:drift,代码行数:14,代码来源:MethodMetadata.java

示例4: create

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
@Override
protected Map<AnEnum, String> create(Entry<AnEnum, String>[] entries) {
  EnumMap<AnEnum, String> map = new EnumMap<AnEnum, String>(AnEnum.class);
  for (Entry<AnEnum, String> entry : entries) {
    map.put(entry.getKey(), entry.getValue());
  }
  return ImmutableMap.copyOf(map);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:9,代码来源:MapGenerators.java

示例5: GenericValue

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
private GenericValue(Builder<T> builder) {
    this.quantities = ImmutableMap.copyOf(builder.quantities);
    int totalQuantity = 0;
    for (Integer quantity : quantities.values()) {
        totalQuantity += quantity;
    }
    this.totalQuantity = totalQuantity;
    this.value = builder.value;
    this.size = calcSize();
}
 
开发者ID:spectrumauctions,项目名称:sats-core,代码行数:11,代码来源:GenericValue.java

示例6: asMap

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
@Nonnull
@Override
public ImmutableMap<MetadataKey<?>, Object> asMap() {
    lock.lock();
    try {
        return ImmutableMap.copyOf(map);
    } finally {
        lock.unlock();
    }
}
 
开发者ID:lucko,项目名称:helper,代码行数:11,代码来源:SimpleMetadataMap.java

示例7: populate

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
private void populate(List<PlanFragment> fragments){
  Map<NodeEndpoint, NodeTracker> trackers = new HashMap<>();
  Map<FragmentHandle, FragmentData> dataCollectors = new HashMap<>();
  ArrayListMultimap<Integer, FragmentData> majors = ArrayListMultimap.create();

  for(PlanFragment fragment : fragments) {
    final NodeEndpoint assignment = fragment.getAssignment();

    NodeTracker tracker = trackers.get(assignment);
    if (tracker == null) {
      tracker = new NodeTracker(assignment);
      trackers.put(assignment, tracker);
    }

    tracker.addFragment();
    FragmentData data = new FragmentData(fragment.getHandle(), assignment);
    dataCollectors.put(fragment.getHandle(), data);
    majors.put(fragment.getHandle().getMajorFragmentId(), data);
  }

  // Major fragments are required to be dense: numbered 0 through N-1
  MajorFragmentReporter[] tempReporters = new MajorFragmentReporter[majors.asMap().size()];
  for(Map.Entry<Integer, Collection<FragmentData>> e : majors.asMap().entrySet()) {
    Preconditions.checkElementIndex(e.getKey(), majors.asMap().size());
    Preconditions.checkState(tempReporters[e.getKey()] == null);
    tempReporters[e.getKey()] = new MajorFragmentReporter(e.getKey(), e.getValue());
  }

  this.reporters = ImmutableList.copyOf(tempReporters);
  this.nodeMap = ImmutableMap.copyOf(trackers);
  this.fragmentDataMap = ImmutableMap.copyOf(dataCollectors);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:33,代码来源:QueryManager.java

示例8: getAllSwitchMap

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public Map<DatapathId, IOFSwitch> getAllSwitchMap(boolean showInvisible) {
	if(showInvisible) {
		return ImmutableMap.<DatapathId, IOFSwitch>copyOf(switches);
	} else {
		ImmutableMap.Builder<DatapathId, IOFSwitch> builder = ImmutableMap.builder();
		for(IOFSwitch sw: switches.values()) {
			if(sw.getStatus().isVisible())
				builder.put(sw.getId(), sw);
		}
		return builder.build();
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:13,代码来源:OFSwitchManager.java

示例9: BlockState

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public BlockState(Block blockIn, IProperty... properties)
{
    this.block = blockIn;
    Arrays.sort(properties, new Comparator<IProperty>()
    {
        public int compare(IProperty p_compare_1_, IProperty p_compare_2_)
        {
            return p_compare_1_.getName().compareTo(p_compare_2_.getName());
        }
    });
    this.properties = ImmutableList.copyOf(properties);
    Map<Map<IProperty, Comparable>, BlockState.StateImplementation> map = Maps.<Map<IProperty, Comparable>, BlockState.StateImplementation>newLinkedHashMap();
    List<BlockState.StateImplementation> list = Lists.<BlockState.StateImplementation>newArrayList();

    for (List<Comparable> list1 : Cartesian.cartesianProduct(this.getAllowedValues()))
    {
        Map<IProperty, Comparable> map1 = MapPopulator.<IProperty, Comparable>createMap(this.properties, list1);
        BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map1));
        map.put(map1, blockstate$stateimplementation);
        list.add(blockstate$stateimplementation);
    }

    for (BlockState.StateImplementation blockstate$stateimplementation1 : list)
    {
        blockstate$stateimplementation1.buildPropertyValueTable(map);
    }

    this.validStates = ImmutableList.<IBlockState>copyOf(list);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:30,代码来源:BlockState.java

示例10: getIndexedModList

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public Map<String,ModContainer> getIndexedModList()
{
    return ImmutableMap.copyOf(namedMods);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:Loader.java

示例11: State

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public State(String name, Map<String, String> properties) {
  this.name = checkNotNull(name, "name == null!");
  this.properties = ImmutableMap.copyOf(properties);
}
 
开发者ID:Energyxxer,项目名称:Vanilla-Injection,代码行数:5,代码来源:State.java

示例12: getConfiguration

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
@Override
public Map<String, String> getConfiguration() {
  return ImmutableMap.copyOf(configuration);
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:5,代码来源:BasicOutboundConfigurationImpl.java

示例13: DefaultEclipseBuildCommand

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public DefaultEclipseBuildCommand(String name, Map<String, String> arguments) {
    this.name = name;
    this.arguments = ImmutableMap.copyOf(arguments);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultEclipseBuildCommand.java

示例14: addPrefixConfig

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
private void addPrefixConfig(final PrefixShardConfiguration config) {
    final Map<DOMDataTreeIdentifier, PrefixShardConfiguration> newPrefixConfigMap = new HashMap<>(prefixConfigMap);
    newPrefixConfigMap.put(config.getPrefix(), config);
    prefixConfigMap = ImmutableMap.copyOf(newPrefixConfigMap);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:ConfigurationImpl.java

示例15: snapshot

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
public CompilationState snapshot() {
    return new CompilationState(ImmutableSet.copyOf(sourceInputs), ImmutableMap.copyOf(fileStates));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:BuildableCompilationState.java


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