Package org.prolog4j

Interface SolutionIterator<S>

  • Type Parameters:
    S - the type of the values of the variable that is of special interest
    All Superinterfaces:
    Iterator<S>

    public interface SolutionIterator<S>
    extends Iterator<S>
    The SolutionIterator interface servers for traversing the solutions of a Prolog query. In a solution several variables can get bound. S is the type of the values of the variable that the is of special interest. Its values are returned by next(). The values of the other variables can be accessed by the get() methods.
    • Method Detail

      • get

        <A> A get​(String variable)
        Returns the value of the variable bound by the current solution.
        Type Parameters:
        A - the type of the value
        Parameters:
        variable - the name of the variable
        Returns:
        the value of the variable in the current solution
      • get

        <A> A get​(String variable,
                  Class<A> type)
        Returns the value of the variable bound by the current solution. The required type of the value can be specified explicitly. This is useful when not the default type is desired.
        Type Parameters:
        A - the type of the value
        Parameters:
        variable - the name of the variable
        type - the type which the value should be converted to
        Returns:
        the value of the variable in the current solution