Class Write
- java.lang.Object
-
- org.projog.core.predicate.AbstractSingleResultPredicate
-
- org.projog.core.predicate.builtin.io.Write
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory
public final class Write extends AbstractSingleResultPredicate
write(X)- writes a term to the output stream.Writes the term
Xto the current output stream.writetakes account of current operator declarations - thus an infix operator will be printed out between its arguments.writerepresents lists as a comma separated sequence of elements enclosed in square brackets.Succeeds only once.
writeln(X)writes the termXto the current output stream, followed by a new line character.writeln(X)can be used as an alternative towrite(X), nl.- See Also:
toString(Term)
-
-
Field Summary
Fields Modifier and Type Field Description private booleanaddNewLine
-
Constructor Summary
Constructors Modifier Constructor Description privateWrite(boolean addNewLine)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanevaluate(Term arg)private java.lang.StringtoString(Term t)static Writewrite()static Writewriteln()private voidwriteString(java.lang.String s)-
Methods inherited from class org.projog.core.predicate.AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBase
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.projog.core.predicate.PredicateFactory
isAlwaysCutOnBacktrack
-
-
-
-
Method Detail
-
write
public static Write write()
-
writeln
public static Write writeln()
-
evaluate
protected boolean evaluate(Term arg)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
writeString
private void writeString(java.lang.String s)
-
toString
private java.lang.String toString(Term t)
-
-