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, waitall, allSolutions, allVariablesSolutions, dispose, hasMoreSolutions, hasSolution, nextSolution, nextVariablesSolution, nSolutions, nVariablesSolutions, oneSolution, oneVariablesSolutionforEachRemainingforEach, spliteratorprotected final AbstractEngine engine
public AbstractQuery(AbstractEngine engine)
public final PrologEngine getEngine()
PrologQuerygetEngine in interface PrologQuerypublic final PrologProvider getProvider()
PrologQuerygetProvider in interface PrologQueryprotected 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()
PrologQueryone in interface PrologQuerypublic final List<Map<String,PrologTerm>> nths(int n)
PrologQuerynths in interface PrologQueryn - list order or Prolog term items numberpublic final Map<String,PrologTerm> more()
PrologQuerymore in interface PrologQuerypublic 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 PrologQuerypublic final List<Object> nextResult()
PrologQuerynextResult in interface PrologQuerypublic final List<List<Object>> nResult(int n)
PrologQuerynResult in interface PrologQueryn - list order or Java objects rows numberpublic final List<List<Object>> allResults()
PrologQueryallResults in interface PrologQuerypublic final Map<String,Object> oneVariablesResult()
PrologQueryoneVariablesResult in interface PrologQuerypublic final Map<String,Object> nextVariablesResult()
PrologQuerynextVariablesResult in interface PrologQuerypublic final List<Map<String,Object>> nVariablesResults(int n)
PrologQuerynVariablesResults in interface PrologQueryn - list order or Java objects items numberpublic final List<Map<String,Object>> allVariablesResults()
PrologQueryallVariablesResults in interface PrologQueryCopyright © 2020–2024 Prolobjectlink Project. All rights reserved.