Class GetChar
- java.lang.Object
-
- org.projog.core.predicate.AbstractSingleResultPredicate
-
- org.projog.core.predicate.builtin.io.GetChar
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory
public final class GetChar extends AbstractSingleResultPredicate
get_char(X)- reads the next character from the input stream.The goal succeeds if
Xcan be unified with next character read from the current input stream. Succeeds only once and the operation of moving to the next character is not undone on backtracking.If there are no more characters to read from the current input stream (i.e. if the end of the stream has been reached) then an attempt is made to unify
Xwith an atom with the valueend_of_file.
-
-
Constructor Summary
Constructors Constructor Description GetChar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanevaluate(Term argument)private AtomtoAtom(int c)private java.lang.StringtoString(int c)-
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
-
evaluate
protected boolean evaluate(Term argument)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
toAtom
private Atom toAtom(int c)
-
toString
private java.lang.String toString(int c)
-
-