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


Java BiMap.entrySet方法代码示例

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


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

示例1: getUnmappedMethodMapping

import com.google.common.collect.BiMap; //导入方法依赖的package包/类
public Optional<MethodRef> getUnmappedMethodMapping(CtClass targetClass, CtMethod
        handleMethod) {
    BiMap<MethodRef, MethodRef> methodsInverted = methodRefs.inverse();
    String descriptor = InjectorPlugin.removeCallbackDescriptor(handleMethod.getMethodInfo2()
            .getDescriptor());
    for (Map.Entry<MethodRef, MethodRef> mapping : methodsInverted.entrySet()) {
        MethodRef key = mapping.getKey();
        if (targetClass.getName().replace('.', '/').equals(key.getOwner()) && handleMethod
                .getName
                ().equals
                (key
                .getName()) && descriptor.equals(key.getDesc())) {
            return Optional.of(mapping.getValue());
        }
    }
    return Optional.empty();
}
 
开发者ID:PizzaCrust,项目名称:Mixinite,代码行数:18,代码来源:Mappings.java

示例2: initData

import com.google.common.collect.BiMap; //导入方法依赖的package包/类
public void initData(SparseMatrix dataMatrix) throws LibrecException {
	Table<Integer, Integer, Double> dataTable = dataMatrix.getDataTable();
	BiMap<String, Integer> userIds = dataModel.getUserMappingData();
	BiMap<String, Integer> itemIds = dataModel.getItemMappingData();
	SparseMatrix dateTimeDataSet = (SparseMatrix) dataModel.getDatetimeDataSet();
	Table<Integer, Integer, Double> dateTimeTable = dateTimeDataSet.getDataTable();
	for (Map.Entry<String, Integer> userId : userIds.entrySet()) {
		for (Map.Entry<String, Integer> itemId : itemIds.entrySet()) {
			Object scValue = dataTable.get(userId.getValue(), itemId.getValue());
			Object dtValue = dateTimeTable.get(userId.getValue(), itemId.getValue());
			if (scValue != null && dtValue != null) {
				Long user_id = Long.parseLong(userId.getKey());
				Long movie_id = Long.parseLong(itemId.getKey());
				Double score = (Double)scValue;
				Double datetime = (Double)dtValue;
				Rating rating = new Rating(user_id, movie_id, score);
				User user = User.findUser(user_id);
				if (user == null) continue;
				MovieEx movie = (MovieEx) MovieEx.findMovie(movie_id);
				if (movie == null) continue;
				try {
					user.addMovie(movie, score, datetime);
					movie.addUser(user, score, datetime);
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
					throw new LibrecException("load rating set error");
				}
				//rating.save();
				Rating.allRatings.add(rating);
			}
		}
	}
}
 
开发者ID:395299296,项目名称:librec-to-movies,代码行数:35,代码来源:RecommendMgr.java

示例3: getUnmappedFieldMapping

import com.google.common.collect.BiMap; //导入方法依赖的package包/类
public Optional<FieldRef> getUnmappedFieldMapping(CtClass targetClass, CtField handleField) {
    BiMap<FieldRef, FieldRef> fieldsInverted = fieldRefs.inverse();
    for (Map.Entry<FieldRef, FieldRef> mapping : fieldsInverted.entrySet()) {
        FieldRef remapped = mapping.getKey();
        if (remapped.getOwner().equals(targetClass.getName().replace('.', '/')) && remapped
                .getName().equals
                (handleField.getName())) {
            return Optional.of(mapping.getValue());
        }
    }
    return Optional.empty();
}
 
开发者ID:PizzaCrust,项目名称:Mixinite,代码行数:13,代码来源:Mappings.java

示例4: ClassNamer

import com.google.common.collect.BiMap; //导入方法依赖的package包/类
public ClassNamer(BiMap<ClassEntry,ClassEntry> mappings) {
	// convert the identity mappings to name maps
	m_sourceNames = Maps.newHashMap();
	m_destNames = Maps.newHashMap();
	int i = 0;
	for (Map.Entry<ClassEntry,ClassEntry> entry : mappings.entrySet()) {
		String name = String.format("M%04d", i++);
		m_sourceNames.put(entry.getKey().getName(), name);
		m_destNames.put(entry.getValue().getName(), name);
	}
}
 
开发者ID:cccssw,项目名称:enigma-vk,代码行数:12,代码来源:ClassNamer.java

示例5: loadFluidDefaults

import com.google.common.collect.BiMap; //导入方法依赖的package包/类
/**
 * Called by forge to load default fluid IDs from the world or from server -> client for syncing
 * DO NOT call this and expect useful behaviour.
 * @param localFluidIDs
 * @param defaultNames
 */
private static void loadFluidDefaults(BiMap<Fluid, Integer> localFluidIDs, Set<String> defaultNames)
{
    // If there's an empty set of default names, use the defaults as defined locally
    if (defaultNames.isEmpty()) {
        defaultNames.addAll(defaultFluidName.values());
    }
    BiMap<String, Fluid> localFluids = HashBiMap.create(fluids);
    for (String defaultName : defaultNames)
    {
        Fluid fluid = masterFluidReference.get(defaultName);
        if (fluid == null) {
            String derivedName = defaultName.split(":",2)[1];
            String localDefault = defaultFluidName.get(derivedName);
            if (localDefault == null) {
                FMLLog.getLogger().log(Level.ERROR, "The fluid {} (specified as {}) is missing from this instance - it will be removed", derivedName, defaultName);
                continue;
            }
            fluid = masterFluidReference.get(localDefault);
            FMLLog.getLogger().log(Level.ERROR, "The fluid {} specified as default is not present - it will be reverted to default {}", defaultName, localDefault);
        }
        FMLLog.getLogger().log(Level.DEBUG, "The fluid {} has been selected as the default fluid for {}", defaultName, fluid.getName());
        Fluid oldFluid = localFluids.put(fluid.getName(), fluid);
        Integer id = localFluidIDs.remove(oldFluid);
        localFluidIDs.put(fluid, id);
    }
    BiMap<Integer, String> localFluidNames = HashBiMap.create();
    for (Entry<Fluid, Integer> e : localFluidIDs.entrySet()) {
        localFluidNames.put(e.getValue(), e.getKey().getName());
    }
    fluidIDs = localFluidIDs;
    fluids = localFluids;
    fluidNames = localFluidNames;
    fluidBlocks = null;
    for (FluidDelegate fd : delegates.values())
    {
        fd.rebind();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:45,代码来源:FluidRegistry.java


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