本文整理汇总了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);
}
示例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) + ")";
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例7: makeToString
import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String makeToString() {
String result = getOpeningBrackets() + " " + Util.join(", ", getElementsDefinitions()) + " " + getClosingBrackets();
return result;
}
示例8: getSubExpressionString
import com.sri.ai.util.Util; //导入方法依赖的package包/类
@Override
public String getSubExpressionString() {
String result = Util.join(", ", getList());
return result;
}
示例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;
}
示例10: getGnuplotCommandLinePlotArguments
import com.sri.ai.util.Util; //导入方法依赖的package包/类
/** @return a comma-separated string of descriptions. */
public String getGnuplotCommandLinePlotArguments() {
return Util.join(",", commandLineDescriptions);
}