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


Java LinkedHashMap.putAll方法代码示例

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


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

示例1: getOriginOfOperand

import java.util.LinkedHashMap; //导入方法依赖的package包/类
private static LinkedHashMap<String, String> getOriginOfOperand(Expression expression) {
    final LinkedHashMap<String, String> map = new LinkedHashMap<>(); // using LinkedHashMap to keep the insertion order
    if (expression.getFirstOperand() instanceof Expression) {
        map.putAll(getOriginOfOperand((Expression) expression.getFirstOperand()));
    } else if (expression.getFirstOperand() instanceof PrimitiveSymbolic) {
        String firstOperand = ((PrimitiveSymbolic)
                expression.getFirstOperand()).getOrigin().toString().substring("{ROOT}:".length());
        if (firstOperand.startsWith("__PARAM") && firstOperand.endsWith("]")) {
            firstOperand = "param" + firstOperand.split("\\[")[1].substring(0, 1);
        }
        map.put(firstOperand,
                expression.getFirstOperand().toString());
    }
    if (expression.getSecondOperand() instanceof Expression) {
        map.putAll(getOriginOfOperand((Expression) expression.getSecondOperand()));
    } else if (expression.getSecondOperand() instanceof PrimitiveSymbolic) {
        String secondOperand = ((PrimitiveSymbolic)
                expression.getSecondOperand()).getOrigin().toString().substring("{ROOT}:".length());
        if (secondOperand.startsWith("__PARAM") && secondOperand.endsWith("]")) {
            secondOperand = "param" + secondOperand.split("\\[")[1].substring(0, 1);
        }
        map.put(secondOperand,
                expression.getSecondOperand().toString());
    }
    return map;
}
 
开发者ID:STAMP-project,项目名称:Ex2Amplifier,代码行数:27,代码来源:JBSERunner.java

示例2: locateRoutes

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
protected Map<String, ZuulRoute> locateRoutes() {
    LinkedHashMap<String, ZuulRoute> routesMap = new LinkedHashMap<>();
    //从application.properties中加载路由信息
    routesMap.putAll(super.locateRoutes());
    //从db中加载路由信息
    routesMap.putAll(getRoutesFromSomewhere());
    //优化一下配置
    LinkedHashMap<String, ZuulRoute> values = new LinkedHashMap<>();
    for (Map.Entry<String, ZuulRoute> entry : routesMap.entrySet()) {
        String path = entry.getKey();
        // Prepend with slash if not already present.
        if (!path.startsWith("/")) {
            path = "/" + path;
        }
        if (StringUtils.hasText(this.properties.getPrefix())) {
            path = this.properties.getPrefix() + path;
            if (!path.startsWith("/")) {
                path = "/" + path;
            }
        }
        values.put(path, entry.getValue());
    }
    log.info("[INFO===>>>]路由信息已更新!");
    return values;
}
 
开发者ID:Paleozoic,项目名称:spring_cloud_demo,代码行数:27,代码来源:CustomRouteLocator.java

示例3: getClassPathEntries

import java.util.LinkedHashMap; //导入方法依赖的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

示例4: getHaplotypeMapFromAlleles

import java.util.LinkedHashMap; //导入方法依赖的package包/类
public static void getHaplotypeMapFromAlleles(final List<Allele> alleleList,
                                              final ReferenceContext ref,
                                              final GenomeLoc loc,
                                              final LinkedHashMap<Allele, Haplotype> haplotypeMap) {
    // protect against having an indel too close to the edge of a contig
    if (loc.getStart() <= HAPLOTYPE_SIZE)
        haplotypeMap.clear();
        // check if there is enough reference window to create haplotypes (can be an issue at end of contigs)
    else if (ref.getWindow().getStop() < loc.getStop() + HAPLOTYPE_SIZE)
        haplotypeMap.clear();
    else if (alleleList.isEmpty())
        haplotypeMap.clear();
    else {
        final int eventLength = getEventLength(alleleList);
        final int hsize = ref.getWindow().size() - Math.abs(eventLength) - 1;
        final int numPrefBases = ref.getLocus().getStart() - ref.getWindow().getStart() + 1;

        if (hsize <= 0)  // protect against event lengths larger than ref window sizes
            haplotypeMap.clear();
        else
            haplotypeMap.putAll(Haplotype.makeHaplotypeListFromAlleles(alleleList, loc.getStart(),
                    ref, hsize, numPrefBases));
    }
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:25,代码来源:IndelGenotypeLikelihoodsCalculationModel.java

示例5: toMap

import java.util.LinkedHashMap; //导入方法依赖的package包/类
protected static final LinkedHashMap<Object, Object> toMap(Object from) {
	LinkedHashMap<Object, Object> map = new LinkedHashMap<Object, Object>();
	if (from instanceof Collection) {
		int count = 0;
		for (Object value : (Collection<?>) from) {
			map.put("key" + count, value);
		}
	} else if (from instanceof Map) {
		map.putAll((Map<?, ?>) from);
	} else if (from.getClass().isArray()) {
		int len = Array.getLength(from);
		for (int i = 0; i < len; i++) {
			map.put("key" + i, Array.get(from, i));
		}
	} else {
		map.put("key", from);
	}
	return map;
}
 
开发者ID:berkesa,项目名称:datatree,代码行数:20,代码来源:AbstractConverterSet.java

示例6: locateRoutes

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
protected LinkedHashMap<String, ZuulRoute> locateRoutes() {
    LinkedHashMap<String, ZuulRoute> routesMap = new LinkedHashMap<String, ZuulRoute>();
    //从application.properties中加载路由信息
    routesMap.putAll(super.locateRoutes());
    //从db中加载路由信息
    routesMap.putAll(locateRoutesFromDB());
    //优化一下配置
    LinkedHashMap<String, ZuulRoute> values = new LinkedHashMap<>();
    for (Map.Entry<String, ZuulRoute> entry : routesMap.entrySet()) {
        String path = entry.getKey();
        // Prepend with slash if not already present.
        if (!path.startsWith("/")) {
            path = "/" + path;
        }
        if (StringUtils.hasText(this.properties.getPrefix())) {
            path = this.properties.getPrefix() + path;
            if (!path.startsWith("/")) {
                path = "/" + path;
            }
        }
        values.put(path, entry.getValue());
    }
    return values;
}
 
开发者ID:xiaomin0322,项目名称:zuul-gateway,代码行数:26,代码来源:CustomRouteLocator.java

示例7: mergePathDefinitions

import java.util.LinkedHashMap; //导入方法依赖的package包/类
public Map<String, Path> mergePathDefinitions(Swagger target, Swagger source) {
	LinkedHashMap<String, Path> mergedDefinitions = new LinkedHashMap<>();
	mergedDefinitions.putAll(target.getPaths());

	Map<String, Path> pathsToBeMerged = source.getPaths();

	for (Entry<String, Path> entry : pathsToBeMerged.entrySet()) {
		if (!mergedDefinitions.containsKey(entry.getKey())) {
			logger.info("source path %s is not present in existing Swagger JSON file.", entry.getKey());
			mergedDefinitions.put(entry.getKey(), entry.getValue());
		} else {
			
			logger.info("source path %s is present in existing Swagger JSON file...merging operations", entry.getKey());
			
			Map<HttpMethod, Operation> modifedOperations = mergeOperationPaths(mergedDefinitions.get(entry.getKey()),
					entry.getValue());
			
			for(Entry<HttpMethod, Operation> operation : modifedOperations.entrySet()){
				mergedDefinitions.get(entry.getKey()).set(operation.getKey().name().toLowerCase(), operation.getValue());
			}				
		}
	}

	return mergedDefinitions;

}
 
开发者ID:pegasystems,项目名称:api2swagger,代码行数:27,代码来源:SwaggerUpdater.java

示例8: mergedModelDefinitions

import java.util.LinkedHashMap; //导入方法依赖的package包/类
public Map<String, Model> mergedModelDefinitions(Swagger target, Swagger source) {
	LinkedHashMap<String, Model> mergedDefinitions = new LinkedHashMap<>();
	
	if(target.getDefinitions() != null ){
		mergedDefinitions.putAll(target.getDefinitions());
	}
	
	if(source.getDefinitions() != null){
		mergedDefinitions.putAll(source.getDefinitions());	
	}
	return mergedDefinitions;
}
 
开发者ID:pegasystems,项目名称:api2swagger,代码行数:13,代码来源:SwaggerUpdater.java

示例9: definition

import java.util.LinkedHashMap; //导入方法依赖的package包/类
private LinkedHashMap<K, V> definition() {
  LinkedHashMap<K, V> result = new LinkedHashMap<>();
  do {
    result.putAll(function());
  } while (lexer.getCurrentToken() == Token.FUNC_NAME);
  return result;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:FunctionParser.java

示例10: getVideoPlayUrl

import java.util.LinkedHashMap; //导入方法依赖的package包/类
public String getVideoPlayUrl(String cid, String aid, String zid, String vid, String uid, String tss, String playid, String tm, String uuid, Map<String, String> adMap) {
    LinkedHashMap<String, String> map = new LinkedHashMap();
    map.put("tm", tm);
    map.put("playid", playid);
    if (TextUtils.equals(tss, "ios")) {
        map.put("tss", tss);
    } else {
        map.put("tss", "no");
    }
    map.put("pcode", LetvConfig.getPcode());
    map.put("version", LetvUtils.getClientVersionName());
    if (!(TextUtils.isEmpty(cid) || TextUtils.equals("0", cid))) {
        map.put("cid", cid);
    }
    if (!(TextUtils.isEmpty(zid) || TextUtils.equals("0", zid))) {
        map.put(PlayConstant.ZID, zid);
    }
    if (!(TextUtils.isEmpty(aid) || TextUtils.equals("0", aid))) {
        map.put("pid", aid);
    }
    if (!(TextUtils.isEmpty(vid) || TextUtils.equals("0", vid))) {
        map.put("vid", vid);
    }
    if (!(TextUtils.isEmpty(uid) || TextUtils.equals("0", uid))) {
        map.put("uid", uid);
    }
    if (!TextUtils.isEmpty(uuid)) {
        map.put("vvid", uuid);
    }
    map.put(HOME_RECOMMEND_PARAMETERS.DEVICEID_KEY, LetvUtils.generateDeviceId(BaseApplication.getInstance()));
    if (!BaseTypeUtils.isMapEmpty(adMap)) {
        map.putAll(adMap);
    }
    return ParameterBuilder.getQueryUrl(map, getPlayUrl());
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:36,代码来源:MediaAssetApi.java

示例11: visitIfStatement

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public String visitIfStatement(JavaParser.IfStatementContext ctx) {
	//'if' parExpression statement ('else' statement)?
	LinkedHashMap<String, JavaClass> tempLocalVariables = new LinkedHashMap<>();
	tempLocalVariables.putAll(localVariables);
	currentContext = ctx;
	visit(ctx.parExpression());
	currentContext = null;
	for (JavaParser.StatementContext cx : ctx.statement()) {
		visit(cx);
	}
	localVariables.clear();
	localVariables.putAll(tempLocalVariables);
	return null;
}
 
开发者ID:ghaffarian,项目名称:progex,代码行数:16,代码来源:JavaICFGBuilder.java

示例12: visitDoWhileStatement

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public String visitDoWhileStatement(JavaParser.DoWhileStatementContext ctx) {
	LinkedHashMap<String, JavaClass> tempLocalVariables = new LinkedHashMap<>();
	tempLocalVariables.putAll(localVariables);
	visit(ctx.statement());
	currentContext = ctx;
	visit(ctx.parExpression());
	currentContext = null;
	localVariables.clear();
	localVariables.putAll(tempLocalVariables);
	return null;
}
 
开发者ID:ghaffarian,项目名称:progex,代码行数:13,代码来源:JavaICFGBuilder.java

示例13: visitForStatement

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public String visitForStatement(JavaParser.ForStatementContext ctx) {
	// 'for' '(' forControl ')' statement
	//forControl:
	//       enhancedForControl |   forInit? ';' expression? ';' forUpdate?
	//enhancedForControl:variableModifier* typeType variableDeclaratorId ':' expression
	LinkedHashMap<String, JavaClass> tempLocalVariables = new LinkedHashMap<>();
	tempLocalVariables.putAll(localVariables);

	if (ctx.forControl().enhancedForControl() != null) {
		currentContext = ctx.forControl().enhancedForControl();
		visit(ctx.forControl().enhancedForControl());
		currentContext = null;
	} else {
		if (ctx.forControl().forInit() != null) {
			currentContext = ctx.forControl().forInit();
			visitChildren(ctx.forControl().forInit());
			currentContext = null;
		}
		if (ctx.forControl().expression() != null) {
			currentContext = ctx.forControl().expression();
			visit(ctx.forControl().expression());
			currentContext = null;
		}
		if (ctx.forControl().forUpdate() != null) {
			currentContext = ctx.forControl().expression();
			visit(ctx.forControl().forUpdate());
			currentContext = null;
		}
	}
	visit(ctx.statement());

	localVariables.clear();
	localVariables.putAll(tempLocalVariables);
	return null;
}
 
开发者ID:ghaffarian,项目名称:progex,代码行数:37,代码来源:JavaICFGBuilder.java

示例14: visitSynchBlockStatement

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public String visitSynchBlockStatement(JavaParser.SynchBlockStatementContext ctx) {
	// 'synchronized' parExpression block
	LinkedHashMap<String, JavaClass> tempLocalVariables = new LinkedHashMap<>();
	tempLocalVariables.putAll(localVariables);
	currentContext = ctx;
	visit(ctx.parExpression());
	currentContext = null;
	visit(ctx.block());
	localVariables.clear();
	localVariables.putAll(tempLocalVariables);
	return null;
}
 
开发者ID:ghaffarian,项目名称:progex,代码行数:14,代码来源:JavaICFGBuilder.java

示例15: visitTryStatement

import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public String visitTryStatement(JavaParser.TryStatementContext ctx) {
	// 'try' block (catchClause+ finallyBlock? | finallyBlock)
	LinkedHashMap<String, JavaClass> tempLocalVariables = new LinkedHashMap<>();
	tempLocalVariables.putAll(localVariables);
	visit(ctx.block());
	localVariables.clear();
	localVariables.putAll(tempLocalVariables);

	if (ctx.finallyBlock() != null) {
		// 'finally' block
		tempLocalVariables.clear();
		tempLocalVariables.putAll(localVariables);
		visit(ctx.finallyBlock().block());
		localVariables.clear();
		localVariables.putAll(tempLocalVariables);
	}

	// Now visit any available catch clauses
	if (ctx.catchClause() != null && ctx.catchClause().size() > 0) {
		// 'catch' '(' variableModifier* catchType Identifier ')' block

		for (JavaParser.CatchClauseContext cx : ctx.catchClause()) {
			tempLocalVariables.clear();
			tempLocalVariables.putAll(localVariables);
			String name = cx.Identifier().getText();
			//Assume that the catch type is a simple class name, for now
			String type = cx.catchType().getText();
			localVariables.put(name, findClassbyName(type));
			visit(cx.block());
			localVariables.clear();
			localVariables.putAll(tempLocalVariables);
		}
	}

	return null;
}
 
开发者ID:ghaffarian,项目名称:progex,代码行数:38,代码来源:JavaICFGBuilder.java


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