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 void
collect(Collection<?>... collections)
Collects the values of the variables into the given collections.protected boolean
fetch()
Fetches the next solution if there is one.<A> A
get(String variable)
Returns the value of the given variable bound to by the first solution of the goal.<A> A
get(String variable, Class<A> type)
Returns the value of the given variable bound by the first solution.boolean
isSuccess()
Returns whether there exists a solution or not.List<?>[]
toLists()
Collects the values of the variables into aList
array.-
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:Solution
Returns 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:Solution
Returns 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:Solution
Returns 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:Solution
Collects the values of the variables into the given collections.
-
toLists
public List<?>[] toLists()
Description copied from class:Solution
Collects the values of the variables into aList
array.
-
-