本文整理匯總了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;
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}