public abstract class AbstractQuery extends AbstractIterator<Collection<PrologTerm>> implements PrologQuery
PrologQuery
interface.Modifier and Type | Field and Description |
---|---|
protected AbstractEngine |
engine |
Constructor and Description |
---|
AbstractQuery(AbstractEngine engine) |
Modifier and Type | Method and Description |
---|---|
List<List<Object>> |
allResults()
Return a list of list of Java Objects that conform the solution set for the
current query.
|
List<Map<String,Object>> |
allVariablesResults()
Return a list of map of variables name key and Java objects as value that
conform the solution set for the current query.
|
protected boolean |
contains(List<Map<String,PrologTerm>> maps,
Map<String,PrologTerm> map) |
protected boolean |
contains(List<PrologTerm[]> arrays,
PrologTerm[] array) |
boolean |
equals(Object obj) |
protected <K> K |
fromTerm(PrologTerm term,
Class<K> to) |
PrologEngine |
getEngine()
Engine hold by the current query
|
protected PrologLogger |
getLogger() |
PrologProvider |
getProvider()
Provider instance
|
int |
hashCode() |
boolean |
hasNext() |
Iterator<Collection<PrologTerm>> |
iterator() |
Map<String,PrologTerm> |
more()
Return the next prolog terms that conform the solution set for the current
query.
|
Collection<PrologTerm> |
next() |
List<Object> |
nextResult()
Return the next Java objects solution list for the current query.
|
Map<String,Object> |
nextVariablesResult()
Return the next Java objects that conform the solution set for the current
query.
|
List<List<Object>> |
nResult(int n)
Return a list of list of Java Objects that conform the solution set for the
current query where n is the solution number and m is a free variable number
in the query.
|
List<Map<String,PrologTerm>> |
nths(int n)
Return a list of n size with maps of variables name key and Prolog terms as
value that conform the solution set for the current query where n is the
solution number.
|
List<Map<String,Object>> |
nVariablesResults(int n)
Return a list of n size with maps of variables name key and Java objects as
value that conform the solution set for the current query where n is the
solution number.
|
Map<String,PrologTerm> |
one()
Return a map of variables name key and Prolog terms as value that conform the
solution set for the current query.
|
List<Object> |
oneResult()
Return the equivalent Java objects that conform the solution set for the
current query.
|
Map<String,Object> |
oneVariablesResult()
Return the equivalent Java objects that conform the solution set for the
current query.
|
void |
remove() |
protected <K extends PrologTerm> |
toTerm(Object o,
Class<K> from) |
protected <K extends PrologTerm,V> |
toTermMapArray(Map<String,V>[] map,
Class<K> from) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
all, allSolutions, allVariablesSolutions, dispose, hasMoreSolutions, hasSolution, nextSolution, nextVariablesSolution, nSolutions, nVariablesSolutions, oneSolution, oneVariablesSolution
forEachRemaining
forEach, spliterator
protected final AbstractEngine engine
public AbstractQuery(AbstractEngine engine)
public final PrologEngine getEngine()
PrologQuery
getEngine
in interface PrologQuery
public final PrologProvider getProvider()
PrologQuery
getProvider
in interface PrologQuery
protected final <K extends PrologTerm> K toTerm(Object o, Class<K> from)
protected final <K extends PrologTerm,V> Map<String,PrologTerm>[] toTermMapArray(Map<String,V>[] map, Class<K> from)
protected final <K> K fromTerm(PrologTerm term, Class<K> to)
protected final boolean contains(List<Map<String,PrologTerm>> maps, Map<String,PrologTerm> map)
protected final boolean contains(List<PrologTerm[]> arrays, PrologTerm[] array)
protected final PrologLogger getLogger()
public final Iterator<Collection<PrologTerm>> iterator()
iterator
in interface Iterable<Collection<PrologTerm>>
public final boolean hasNext()
hasNext
in interface Iterator<Collection<PrologTerm>>
public final Collection<PrologTerm> next()
next
in interface Iterator<Collection<PrologTerm>>
public final void remove()
remove
in interface Iterator<Collection<PrologTerm>>
remove
in class AbstractIterator<Collection<PrologTerm>>
public final Map<String,PrologTerm> one()
PrologQuery
one
in interface PrologQuery
public final List<Map<String,PrologTerm>> nths(int n)
PrologQuery
nths
in interface PrologQuery
n
- list order or Prolog term items numberpublic final Map<String,PrologTerm> more()
PrologQuery
more
in interface PrologQuery
public final List<Object> oneResult()
PrologQuery
List<Object> solution = query.oneResult(); for (int i = 0; i < solution.size(); i++) { System.out.println(solution.get(i)); }
oneResult
in interface PrologQuery
public final List<Object> nextResult()
PrologQuery
nextResult
in interface PrologQuery
public final List<List<Object>> nResult(int n)
PrologQuery
nResult
in interface PrologQuery
n
- list order or Java objects rows numberpublic final List<List<Object>> allResults()
PrologQuery
allResults
in interface PrologQuery
public final Map<String,Object> oneVariablesResult()
PrologQuery
oneVariablesResult
in interface PrologQuery
public final Map<String,Object> nextVariablesResult()
PrologQuery
nextVariablesResult
in interface PrologQuery
public final List<Map<String,Object>> nVariablesResults(int n)
PrologQuery
nVariablesResults
in interface PrologQuery
n
- list order or Java objects items numberpublic final List<Map<String,Object>> allVariablesResults()
PrologQuery
allVariablesResults
in interface PrologQuery
Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.