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


Java Multimap.put方法代码示例

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


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

示例1: initProjectLocation

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
private Multimap<String, IProject> initProjectLocation() {
	final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
	final IProject[] projects = root.getProjects();
	final Multimap<String, IProject> locations = HashMultimap.create();

	// initialize the repository paths
	repositoryPaths = repositoriesProvider.getWorkspaceRepositories().stream()
			.map(r -> r.getDirectory().getParentFile().toPath()).collect(Collectors.toSet());

	for (final IProject project : projects) {
		if (isRemoteEditNature(project)) {
			continue;
		}
		final String pair = getWorkingSetId(project);
		locations.put(pair, project);
	}

	return locations;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:ProjectLocationAwareWorkingSetManager.java

示例2: generateSubtypes

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
private void generateSubtypes(SourceSet src, Multimap<TypeEntry, TypeEntry> subtypes) {
    for (TypeEntry type : src.getAllClasses()) {
        if (type instanceof ClassEntry) {
            ClassEntry cls = (ClassEntry) type;
            TypeEntry spr = src.get(cls.getSuperclassName());
            if (spr != null) {
                subtypes.put(spr, type);
            }
        }
        for (String intr : type.getInterfaces()) {
            TypeEntry inter = src.get(intr);
            if (inter != null) {
                subtypes.put(inter, type);
            }
        }
    }
}
 
开发者ID:Despector,项目名称:ObfuscationMapper,代码行数:18,代码来源:MergeEngine.java

示例3: getAbiSoFiles

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
/**
 * Verify the directory of the so file under the abi
 *
 * @param supportAbis
 * @param removeSoFiles
 * @param dirs
 * @return
 */
public static Map<String, Multimap<String, File>> getAbiSoFiles(Set<String> supportAbis, Set<String> removeSoFiles,
                                                                List<File> dirs) {
    Map<String, Multimap<String, File>> result = new HashMap<String, Multimap<String, File>>();
    IOFileFilter filter = new NativeSoFilter(supportAbis, removeSoFiles);
    for (File dir : dirs) {
        Collection<File> files = FileUtils.listFiles(dir, filter, TrueFileFilter.TRUE);
        for (File file : files) {
            File parentFolder = file.getParentFile();
            String parentName = parentFolder.getName();
            String shortName = getSoShortName(file);
            Multimap<String, File> maps = result.get(parentName);
            if (null == maps) {
                maps = HashMultimap.create(10, 3);
            }
            maps.put(shortName, file);
            result.put(parentName, maps);
        }

    }
    return result;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:30,代码来源:NativeSoUtils.java

示例4: rateMatrix

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
/**
 * retrieve a rating matrix from the tensor. Warning: it assumes there is at most one entry for each (user, item)
 * pair.
 *
 * @return a sparse rating matrix
 */
public SparseMatrix rateMatrix() {

	Table<Integer, Integer, Double> dataTable = HashBasedTable.create();
	Multimap<Integer, Integer> colMap = HashMultimap.create();

	for (TensorEntry te : this) {
		int u = te.key(userDimension);
		int i = te.key(itemDimension);

		dataTable.put(u, i, te.get());
		colMap.put(i, u);
	}

	return new SparseMatrix(dimensions[userDimension], dimensions[itemDimension], dataTable, colMap);
}
 
开发者ID:xiaojieliu7,项目名称:MicroServiceProject,代码行数:22,代码来源:SparseTensor.java

示例5: add31PostReadMigrators

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
private void add31PostReadMigrators(Multimap<String, String> postReadMigs)
{
	postReadMigs.put("3.1", "com.tle.ims.migration.IMSNavigationCreation");
	postReadMigs.put("3.1", "com.tle.core.institution.migration.EnsureAttachmentUUID");
	postReadMigs.put("3.1", "com.tle.core.institution.migration.SearchDetailsUpdate");
	postReadMigs.put("3.1", "com.tle.core.institution.migration.ConfigPropertyChange");
	postReadMigs.put("3.1", "com.tle.core.institution.migration.AclPriorityChange");
}
 
开发者ID:equella,项目名称:Equella,代码行数:9,代码来源:LegacyMigrationInstitutionInfoInitialiser.java

示例6: getAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
    Multimap<String, AttributeModifier> multimap;

    if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers", 9))
    {
        multimap = HashMultimap.<String, AttributeModifier>create();
        NBTTagList nbttaglist = this.stackTagCompound.getTagList("AttributeModifiers", 10);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            AttributeModifier attributemodifier = SharedMonsterAttributes.readAttributeModifierFromNBT(nbttagcompound);

            if (attributemodifier != null && (!nbttagcompound.hasKey("Slot", 8) || nbttagcompound.getString("Slot").equals(equipmentSlot.getName())) && attributemodifier.getID().getLeastSignificantBits() != 0L && attributemodifier.getID().getMostSignificantBits() != 0L)
            {
                multimap.put(nbttagcompound.getString("AttributeName"), attributemodifier);
            }
        }
    }
    else
    {
        multimap = this.getItem().getAttributeModifiers(equipmentSlot, this);
    }

    return multimap;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:ItemStack.java

示例7: getAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{
	Multimap multimap = HashMultimap.create();
	multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", weaponBaseDamage, 0));
	return multimap;
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:8,代码来源:ItemWoodenClub.java

示例8: typeAdapters

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
public Iterable<TypeAdapterTypes> typeAdapters() {
  Map<AbstractDeclaring, GsonMirrors.TypeAdapters> mirrors = Maps.newHashMap();

  Multimap<AbstractDeclaring, ValueType> byDeclaring = HashMultimap.create();
  for (ValueType value : values().values()) {
    Protoclass protoclass = value.constitution.protoclass();
    if (protoclass.kind().isValue()) {
      Optional<AbstractDeclaring> typeAdaptersProvider = protoclass.typeAdaptersProvider();
      if (typeAdaptersProvider.isPresent()) {
        AbstractDeclaring key = typeAdaptersProvider.get();
        mirrors.put(key, key.typeAdapters().get());
        byDeclaring.put(key, value);
      } else if (protoclass.gsonTypeAdapters().isPresent()
          && protoclass.declaringType().isPresent()) {
        DeclaringType topLevel = protoclass.declaringType().get().associatedTopLevel();
        mirrors.put(topLevel, protoclass.gsonTypeAdapters().get());
        byDeclaring.put(topLevel, value);
      }
    }
  }

  ImmutableList.Builder<TypeAdapterTypes> builder = ImmutableList.builder();
  for (Entry<AbstractDeclaring, Collection<ValueType>> entry : byDeclaring.asMap().entrySet()) {
    String pack = Iterables.get(entry.getValue(), 0).$$package();
    builder.add(ImmutableTypeAdapterTypes.builder()
        .definedBy(entry.getKey())
        .mirror(mirrors.get(entry.getKey()))
        .packageGenerated(pack)
        .addAllTypes(entry.getValue())
        .build());
  }

  return builder.build();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:35,代码来源:Gsons.java

示例9: getAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot,
		ItemStack stack) {
	Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(),
				new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) 3.0F, 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
				new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double) -3F, 0));
	}

	return multimap;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:15,代码来源:ItemRock.java

示例10: getItemAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

    if (equipmentSlot == EntityEquipmentSlot.MAINHAND)
    {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0D, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double)(this.speed - 4.0F), 0));
    }

    return multimap;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:ItemHoe.java

示例11: getAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
	Multimap<String, AttributeModifier> modifiers = HashMultimap.create();
	if (slot==EntityEquipmentSlot.HEAD) {
		modifiers.put(
				SharedMonsterAttributes.ARMOR.getName(),
				new AttributeModifier(UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150"), "Armor modifier", 3D, 0)
				);

	}
	
	return modifiers;
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:14,代码来源:BlockPotStill.java

示例12: getTags

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
public Multimap<String, String> getTags() {
	Multimap<String,String> tags = ArrayListMultimap.create();

	for (Entry<String, ReferenceModel> e : references.entrySet()) {
		for(String t : e.getValue().getTags())
			tags.put(e.getKey(), t);
	}
	return tags;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:10,代码来源:ObjectModel.java

示例13: getItemAttributeModifiers

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

    if (equipmentSlot == EntityEquipmentSlot.MAINHAND)
    {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", (double)this.damageVsEntity, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double)this.attackSpeed, 0));
    }

    return multimap;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:ItemTool.java

示例14: lookupFlat

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
/**
     * Lookup only pref keys / this skips results isomorphic to the given keys
     * @param queryGraph
     * @param exactMatch
     * @return
     */
    public Multimap<K, BiMap<V, V>> lookupFlat(G queryGraph, boolean exactMatch) {

        Set<T> queryGraphTags = extractGraphTagsWrapper(queryGraph);


        Collection<InsertPosition<K, G, V, T>> positions = new LinkedList<>();

        findInsertPositions(positions, rootNode, queryGraph, queryGraphTags, HashBiMap.create(), HashBiMap.create(), true, exactMatch); //, writer);

        Multimap<K, BiMap<V, V>> result = HashMultimap.create();

        if(logger.isDebugEnabled()) {
            logger.debug("Lookup result candidates: " + positions.size());
        }

        for(InsertPosition<K, G, V, T> pos : positions) {
            // Match with the children

            result.put(pos.getNode().getKey(), pos.getIso());
            //System.out.println("Node " + pos.node + " with keys " + pos.node.getKeys() + " iso: " + pos.getGraphIso().getInToOut());
//            for(K key : pos.node.getKeys()) {
//                result.put(key, pos.getIso());
//            }
        }
        return result;
    }
 
开发者ID:SmartDataAnalytics,项目名称:SubgraphIsomorphismIndex,代码行数:33,代码来源:SubgraphIsomorphismIndexImpl.java

示例15: add31ItemMigrators

import com.google.common.collect.Multimap; //导入方法依赖的package包/类
private void add31ItemMigrators(Multimap<String, String> itemXmlMigs)
{
	itemXmlMigs.put("3.1", "com.tle.core.institution.migration.DisallowOldStyleCalItems");
	itemXmlMigs.put("3.1", "com.tle.core.institution.migration.RemoveDeprecatedItemParts");
	itemXmlMigs.put("3.1", "com.tle.core.institution.migration.LanguageBundleMigration");
}
 
开发者ID:equella,项目名称:Equella,代码行数:7,代码来源:LegacyMigrationInstitutionInfoInitialiser.java


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