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


Java Util.join方法代码示例

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


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

示例1: FirstOfStepSolver

import com.sri.ai.util.Util; //导入方法依赖的package包/类
public FirstOfStepSolver(String name, Expression expression, List<? extends Rewriter> baseRewriters) {
	super();
	this.name = name.equals("")? "Step solver for FirstOf rewriter based on " + Util.join(baseRewriters) + " for " + expression : name;
	this.expression = expression;
	this.baseRewriters = baseRewriters;
	setCurrentBaseRewriterIndex(0);
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:8,代码来源:FirstOf.java

示例2: toStringWithoutCaching

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String toStringWithoutCaching() {
	String rootTreeString = getRootTree().toString();
	if ( ! (getRootTree() instanceof SyntaxLeaf)) {
		rootTreeString = "(" + rootTreeString + ")";
	}
	Iterator stringOfSubTrees =
		new FunctionIterator<SyntaxTree, String>(new ToStringWithoutCaching(), getImmediateSubTrees());
	return rootTreeString + "(" + Util.join(", ", stringOfSubTrees) + ")";
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:11,代码来源:DefaultCompoundSyntaxTree.java

示例3: makeToString

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String makeToString() {
	String result;
	if (numberOfArguments() == 1) {
		result = "tuple(" + get(0) + ")";
	}
	else {
		result = "(" + Util.join(", ", getArguments()) + ")";
	}
	return result;
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:12,代码来源:DefaultTuple.java

示例4: computeFunction

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
protected String computeFunction() {
	List<String> result = new LinkedList<String>();
	for (Iterator<String> argument : getArguments()) {
		result.add(getCurrentArgumentValue(argument));
	}
	return Util.join(result);
}
 
开发者ID:aic-sri-international,项目名称:aic-util,代码行数:9,代码来源:FunctionalSequenceTest.java

示例5: computeFunction

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
protected String computeFunction() {
	List<String> result = new LinkedList<String>();
	for (Refiner<String> argument : getArguments()) {
		result.add(getCurrentArgumentValue(argument));
	}
	return Util.join(result);
}
 
开发者ID:aic-sri-international,项目名称:aic-util,代码行数:9,代码来源:FunctionalRefinerTest.java

示例6: getDomainSizes

import com.sri.ai.util.Util; //导入方法依赖的package包/类
private String getDomainSizes(String model) {
	ExpressionFactorsAndTypes factorsAndTypes = new ExpressionFactorsAndTypes(model);
	Collection<Type> types = factorsAndTypes.getAdditionalTypes();
	List<Integer> domainSizes = mapIntoList(types, t -> t.cardinality().intValueExact());
	String result = Util.join(domainSizes);
	return result;
}
 
开发者ID:aic-sri-international,项目名称:aic-praise,代码行数:8,代码来源:Evaluation.java

示例7: makeToString

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String makeToString() {
	String result = getOpeningBrackets() + " " + Util.join(", ", getElementsDefinitions()) + " " + getClosingBrackets();
	return result;
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:6,代码来源:AbstractExtensionalSet.java

示例8: getSubExpressionString

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String getSubExpressionString() {
	String result = Util.join(", ", getList()); 
	return result;
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:6,代码来源:ExtensionalIndexExpressionsSet.java

示例9: makeToString

import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String makeToString() {
	String result;
	if (hasFunctor(FunctorConstants.IF_THEN_ELSE)) {
		result = "if " + get(0) + " then " + get(1) + " else " + stringAsSubExpression(get(2), getPrecedence(this));
	}
	else if (hasFunctor(FunctorConstants.CARDINALITY) && numberOfArguments() == 1) {
		result = "| " + get(0) + " |";
	}
	else if (hasFunctor(FunctorConstants.REAL_INTERVAL_CLOSED_CLOSED) && numberOfArguments() == 2) {
		result = "[" + get(0) + ";" + get(1) + "]";
	}
	else if (hasFunctor(FunctorConstants.REAL_INTERVAL_OPEN_CLOSED) && numberOfArguments() == 2) {
		result = "]" + get(0) + ";" + get(1) + "]";
	}
	else if (hasFunctor(FunctorConstants.REAL_INTERVAL_CLOSED_OPEN) && numberOfArguments() == 2) {
		result = "[" + get(0) + ";" + get(1) + "[";
	}
	else if (hasFunctor(FunctorConstants.REAL_INTERVAL_OPEN_OPEN) && numberOfArguments() == 2) {
		result = "]" + get(0) + ";" + get(1) + "[";
	}
	else {
		int precedence = getPrecedence(this);
		if (hasFunctor(FunctorConstants.MINUS) && numberOfArguments() == 1) {
			result = "-" + stringAsSubExpression(get(0), precedence);
		}
		else if (hasFunctor(FunctorConstants.NOT) && numberOfArguments() == 1) {
			result = "not " + stringAsSubExpression(get(0), precedence);
		}
		else {
			String functorString = getFunctor().toString();
			String functorRepresentation = getFunctor() instanceof Symbol? functorString : "(" + getFunctor() + ")";
			if (_infixFunctionsStrings.contains(functorString)) {
				List<String> subExpressionsStrings = mapIntoList(getArguments(), e -> stringAsSubExpressionWithParenthesesIfSamePrecedence(e, precedence));
				if (hasFunctor(INTEGER_INTERVAL) && numberOfArguments() == 2) {
					// no spaces between functor and arguments
					result = subExpressionsStrings.get(0) + ".." + subExpressionsStrings.get(1);
				}
				else {
					if (numberOfArguments() == 0) {
						result = functorRepresentation+"()";
					}
					else if (numberOfArguments() == 1) {
						result = functorRepresentation+"("+subExpressionsStrings.get(0)+")";
					}
					else {
						result = Util.join(" " + getFunctor() + " ", subExpressionsStrings);
					}
				}
			}
			else {					
				String argumentsRepresentation = Util.join(", ", getArguments());
				result = functorRepresentation + "(" + argumentsRepresentation + ")";
			}
		}
	}
	return result;
}
 
开发者ID:aic-sri-international,项目名称:aic-expresso,代码行数:59,代码来源:DefaultFunctionApplication.java

示例10: getGnuplotCommandLinePlotArguments

import com.sri.ai.util.Util; //导入方法依赖的package包/类
/** @return a comma-separated string of descriptions. */
public String getGnuplotCommandLinePlotArguments() {
	return Util.join(",", commandLineDescriptions);
}
 
开发者ID:aic-sri-international,项目名称:aic-util,代码行数:5,代码来源:GnuplotData.java


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