本文整理汇总了Java中jason.asSyntax.Term.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Term.toString方法的具体用法?Java Term.toString怎么用?Java Term.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jason.asSyntax.Term
的用法示例。
在下文中一共展示了Term.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import jason.asSyntax.Term; //导入方法依赖的package包/类
@Override
public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
checkArguments(args);
Term ilf = args[0];
Term pcnt = args[1];
Message m = new Message(ilf.toString(), ts.getUserAgArch().getAgName(), null, pcnt);
ts.getUserAgArch().broadcast(m);
return true;
}
示例2: delegateSendToArch
import jason.asSyntax.Term; //导入方法依赖的package包/类
private void delegateSendToArch(Term to, TransitionSystem ts, Message m) throws Exception {
if (!to.isAtom() && !to.isString())
throw new JasonException("The TO parameter ('"+to+"') of the internal action 'send' is not an atom!");
String rec = null;
if (to.isString())
rec = ((StringTerm)to).getString();
else
rec = to.toString();
if (rec.equals("self"))
rec = ts.getUserAgArch().getAgName();
m.setReceiver(rec);
ts.getUserAgArch().sendMsg(m);
}
示例3: getWhere
import jason.asSyntax.Term; //导入方法依赖的package包/类
/** returns the where clausule for a select for literal l */
protected String getWhere(Literal l) throws SQLException {
ResultSetMetaData meta = belsDB.get(l.getPredicateIndicator());
StringBuilder q = new StringBuilder(" where ");
String and = "";
// for all ground terms of l
for (int i = 0; i < l.getArity(); i++) {
Term t = l.getTerm(i);
if (t.isGround()) {
q.append(and);
String ts;
if (t.isString()) {
ts = "'" + ((StringTerm) t).getString() + "'";
} else if (t.isNumeric()) {
ts = t.toString();
} else {
ts = "'" + t.toString() + "'";
}
q.append(meta.getColumnName(i + 1) + " = " + ts);
and = " and ";
}
}
if (isCreatedByJason(l.getPredicateIndicator())) {
q.append(and + COL_NEG + " = " + l.negated());
}
//System.out.println(q.toString());
if (and.length() > 0) // add nothing in the clausule
return q.toString();
else
return "";
}