public class JoSQLComparator extends Object implements Comparator
| 构造器和说明 |
|---|
JoSQLComparator(Query q)
Init this file filter with the query already built and parsed.
|
JoSQLComparator(String q)
Init this filter with the query.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearCache()
Clear the cache, it is VITAL that you call this method before you use
the comparator (if it has been used before) otherwise data objects will
be "left around" and preventing the GC from cleaning them up.
|
int |
compare(Object o1,
Object o2)
Compares the objects as according to the ORDER BY clause.
|
void |
doExecuteOn(List l)
Execute the EXECUTE ON ALL expressions.
|
Exception |
getException()
The
Comparator.compare(Object,Object) method does not allow for
any exceptions to be thrown however since the execution of the ORDER BY clause
on the objects can cause the throwing of a QueryParseException it should
be captured. |
Query |
getQuery()
Get the Query we are using to process objects.
|
boolean |
isCaching()
Return whether this comparator uses caching to improve performance.
|
void |
setCaching(boolean b)
Set whether the comparator should use caching to improve performance.
|
void |
setQuery(Query q)
Set a new Query object for use in this filter.
|
void |
setQuery(String q)
Set a new Query (string form) for use in this filter.
|
public JoSQLComparator(String q) throws QueryParseException
q - The query.QueryParseException - If there is an issue with the parsing of the query.public JoSQLComparator(Query q) throws IllegalStateException, QueryParseException
q - The query.IllegalStateException - If the Query object has not been parsed.QueryParseException - If the FROM class is not as expected.public void doExecuteOn(List l) throws QueryExecutionException
l - The list to execute the expressions on.QueryExecutionExceptionpublic void clearCache()
public boolean isCaching()
throws IllegalStateException
true if caching is on.IllegalStateException - If the query has not yet been parsed or set.public void setCaching(boolean b)
throws IllegalStateException
b - Set to true to turn caching on.IllegalStateException - If the query has not yet been parsed or set.public int compare(Object o1, Object o2)
compare 在接口中 Comparatoro1 - The first object.o2 - The second object.public Exception getException()
Comparator.compare(Object,Object) method does not allow for
any exceptions to be thrown however since the execution of the ORDER BY clause
on the objects can cause the throwing of a QueryParseException it should
be captured. If the exception is thrown then this method will return it.compare(Object,Object)
or by sub-class/interface specific methods, this may be null if no exception was thrown.public void setQuery(String q) throws QueryParseException
q - The Query to use.QueryParseException - If there is an issue with the parsing of the query,
or if the FROM class is not as expected.public void setQuery(Query q) throws IllegalStateException, QueryParseException
q - The Query to use.IllegalStateException - If the Query object has not been parsed.QueryParseException - If the FROM class is not as expected.public Query getQuery()
Copyright © 2021. All rights reserved.