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


Java Builder.put方法代码示例

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


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

示例1: registerNotificationListener

import com.google.common.collect.ImmutableMultimap.Builder; //导入方法依赖的package包/类
@Override
public synchronized <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final Collection<SchemaPath> types) {
    final ListenerRegistration<T> reg = new AbstractListenerRegistration<T>(listener) {
        @Override
        protected void removeRegistration() {
            final ListenerRegistration<T> me = this;

            synchronized (DOMNotificationRouter.this) {
                replaceListeners(ImmutableMultimap.copyOf(Multimaps.filterValues(listeners, input -> input != me)));
            }
        }
    };

    if (!types.isEmpty()) {
        final Builder<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> b = ImmutableMultimap.builder();
        b.putAll(listeners);

        for (final SchemaPath t : types) {
            b.put(t, reg);
        }

        replaceListeners(b.build());
    }

    return reg;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:27,代码来源:DOMNotificationRouter.java

示例2: BratRelation

import com.google.common.collect.ImmutableMultimap.Builder; //导入方法依赖的package包/类
public BratRelation(BratRelationType type, BratEntity arg1, BratEntity arg2) {
    super(type, ImmutableMultimap.<String, BratEntity>of());
    if (!checkArgVal(arg1) || !checkArgVal(arg2)) {
        throw new IllegalArgumentException(String.format(
                "Relation %s arguments: %s, %s", type, arg1, arg2));
    }
    Builder<String, BratEntity> b = ImmutableMultimap.builder();
    b.put(type.getArg1Name(), arg1);
    b.put(type.getArg2Name(), arg2);
    setRoleAnnotations(b.build());
}
 
开发者ID:textocat,项目名称:textokit-core,代码行数:12,代码来源:BratRelation.java

示例3: getActionContexts

import com.google.common.collect.ImmutableMultimap.Builder; //导入方法依赖的package包/类
@Override
public Multimap<Class<? extends ActionContext>, String> getActionContexts() {
  Builder<Class<? extends ActionContext>, String> contexts = ImmutableMultimap.builder();
  contexts.put(SpawnActionContext.class, "standalone");
  contexts.put(SpawnActionContext.class, "worker");
  return contexts.build();
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:8,代码来源:WorkerActionContextConsumer.java

示例4: setAllInstitutions

import com.google.common.collect.ImmutableMultimap.Builder; //导入方法依赖的package包/类
private synchronized void setAllInstitutions(Map<Long, InstitutionStatus> map)
{
	allInstitutions = ImmutableMap.copyOf(map);

	Multimap<Long, Institution> newlyAvailable = ArrayListMultimap.create();
	Multimap<Long, Institution> newlyUnavailable = ArrayListMultimap.create(availableInstitutions);
	Builder<Long, Institution> availableBuilder = ImmutableMultimap.builder();
	ImmutableMap.Builder<Long, Long> schemaBuilder = ImmutableMap.builder();
	ImmutableMap.Builder<Long, Institution> instBuilder = ImmutableMap.builder();
	for( Entry<Long, InstitutionStatus> entry : allInstitutions.entrySet() )
	{
		InstitutionStatus instStatus = entry.getValue();
		Institution institution = instStatus.getInstitution();
		Long schemaId = instStatus.getSchemaId();
		if( instStatus.isValid() && institution.isEnabled() )
		{
			availableBuilder.put(schemaId, institution);
			if( !newlyUnavailable.remove(schemaId, institution) )
			{
				newlyAvailable.put(schemaId, institution);
			}
		}
		long uniqueId = institution.getUniqueId();
		schemaBuilder.put(uniqueId, schemaId);
		instBuilder.put(uniqueId, institution);
	}

	availableInstitutions = availableBuilder.build();
	schemaMap = schemaBuilder.build();
	instMap = instBuilder.build();

	if( !newlyAvailable.isEmpty() )
	{
		eventService.publishApplicationEvent(new InstitutionEvent(InstitutionEventType.AVAILABLE, newlyAvailable));
	}

	if( !newlyUnavailable.isEmpty() )
	{
		eventService
				.publishApplicationEvent(new InstitutionEvent(InstitutionEventType.UNAVAILABLE, newlyUnavailable));
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:43,代码来源:InstitutionServiceImpl.java

示例5: PackageComparator

import com.google.common.collect.ImmutableMultimap.Builder; //导入方法依赖的package包/类
public PackageComparator(final SortedSetMultimap<String, ModuleDescriptor> resolvedModuleDependencies) {
	this.resolvedModuleDependencies = Preconditions.checkNotNull(resolvedModuleDependencies);
	
	final Set<Entry<String,ModuleDescriptor>> entries = resolvedModuleDependencies.entries();
	
	final Builder<String, ModuleDescriptor> builder = ImmutableMultimap.builder();
	for (final Entry<String, ModuleDescriptor> entry : entries) {
		final String javaPackageName = entry.getValue().getJavaPackageName();
		
		builder.put(javaPackageName, entry.getValue());
		
	}
	
	this.modulesByPackageName = builder.build();
	
	
}
 
开发者ID:struktured,项目名称:ocamljava-maven-plugin,代码行数:18,代码来源:PackageComparator.java


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