Package org.prolog4j.swi.impl
Class SWIPrologSolution<S>
- java.lang.Object
-
- org.prolog4j.Solution<S>
-
- org.prolog4j.swi.impl.SWIPrologSolution<S>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollect(Collection<?>... collections)Collects the values of the variables into the given collections.protected booleanfetch()Fetches the next solution if there is one.<A> Aget(String variable)Returns the value of the given variable bound to by the first solution of the goal.<A> Aget(String variable, Class<A> type)Returns the value of the given variable bound by the first solution.booleanisSuccess()Returns whether there exists a solution or not.List<?>[]toLists()Collects the values of the variables into aListarray.-
Methods inherited from class org.prolog4j.Solution
collect, collect, get, get, iterator, on, on, toList, toSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
isSuccess
public boolean isSuccess()
Description copied from class:SolutionReturns whether there exists a solution or not. Does not depend on the state of the traversal, only one solution should exist.
-
get
public <A> A get(String variable)
Description copied from class:SolutionReturns the value of the given variable bound to by the first solution of the goal.
-
get
public <A> A get(String variable, Class<A> type)
Description copied from class:SolutionReturns the value of the given variable bound by the first solution. The required type of the value can be specified explicitly. This is useful when not the default type is desired.
-
collect
public void collect(Collection<?>... collections)
Description copied from class:SolutionCollects the values of the variables into the given collections.
-
toLists
public List<?>[] toLists()
Description copied from class:SolutionCollects the values of the variables into aListarray.
-
-