public class QueryEngine
extends java.lang.Object
| Constructor and Description |
|---|
QueryEngine()
Create a new instance of QueryEngine.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allowsCase(java.lang.String queryType)
Return true if the query type allows case sensitive comparisons, that is,
not numerical.
|
static boolean |
allowsWildcards(java.lang.String constraintType)
Return true if the constraint type can process wildcards.
|
static boolean |
constraintIsAttribute(java.lang.String constraintType)
Return true if the constraint type requires a value.
|
static boolean |
constraintNeedsValue(java.lang.String constraintType)
Return true if the constraint type requires a value.
|
static java.util.ArrayList<java.lang.String> |
getComparisonOps(boolean equivalenceOnly)
Return a list of the comparison operators.
|
static java.util.ArrayList<java.lang.String> |
getConstraintTypes(java.lang.String queryType,
java.lang.String queryState,
boolean includeWildcards)
Get a list of all constraint types for the xml-related queries.
|
static java.lang.String |
getCorrectTextType(java.lang.String queryType,
java.lang.String constraintType)
Get the correct text type for the constraint.
|
static java.util.ArrayList<java.lang.String> |
getLogicalOps()
Return a list of the logical operators.
|
static java.lang.String |
getReciprocalComparison(java.lang.String comparison)
Return the reciprocal comparison to the one entered,
for example a
LT would return a GT. |
static java.util.ArrayList<java.lang.String> |
getTextTypes()
Get a list of all types for the text-related queries.
|
protected int |
getWildcardCount(java.lang.String theChar)
Return true number wildcard character characters to remove.
|
protected boolean |
isCurrencyChar(char theChar)
Return true if the character represents a currency character.
|
protected boolean |
isEndConstraint(java.lang.String constraintType)
Return true if the value is recognised as an end constraint type.
|
static boolean |
isNumericalConstraint(java.lang.String constraintType)
Return true if the constraint tye is a numerical constraint.
|
static boolean |
isNumericalQueryType(java.lang.String queryType)
Return true if the query type is a numerical type (numerical evaluation).
|
static boolean |
isOtherQueryType(java.lang.String queryType)
Return true if the query type is a special type (specific evaluation).
|
static boolean |
isPatternType(java.lang.String constraintType)
Return true if the value should be added as part of the pattern.
|
static boolean |
isRangeConstraint(java.lang.String constraintType)
Return true if the value is recognised a range constraint type.
|
static boolean |
isSearchType(java.lang.String searchType)
Return true if the value is recognised as a search type.
|
static boolean |
isSingleConstraint(java.lang.String constraintType)
Return true if the value is recognised a single constraint type.
|
protected boolean |
isStartConstraint(java.lang.String constraintType)
Return true if the value is recognised as a start constraint type.
|
static boolean |
isTextQueryType(java.lang.String queryType)
Return true if the query type is a text-based type (lines of text).
|
protected boolean |
isWildcard(char theChar)
Return true if the character represents a wildcard character.
|
protected boolean |
isWildcard(java.lang.String theChar)
Return true if the first character represents a wildcard character.
|
static boolean |
isXmlQueryType(java.lang.String queryType)
Return true if the query type is a pattern-based XML type.
|
protected java.util.ArrayList<java.lang.String> |
parseWildcards(java.lang.String searchTerm)
Parse the search term and convert into separate parts with wildcards.
|
protected java.util.ArrayList<java.lang.String> parseWildcards(java.lang.String searchTerm)
searchTerm - the search term.protected boolean isWildcard(char theChar)
theChar - the character to evaluate.protected boolean isWildcard(java.lang.String theChar)
theChar - the string to evaluate.protected int getWildcardCount(java.lang.String theChar)
theChar - the string to evaluate.public static boolean isXmlQueryType(java.lang.String queryType)
queryType - the query type to check.QueryConst.ASXML.public static boolean isTextQueryType(java.lang.String queryType)
queryType - the query type to check.QueryConst.ASTEXT or TEXT.public static boolean isNumericalQueryType(java.lang.String queryType)
queryType - the query type to check.QueryConst.NUMERICAL, ASMATHCOMPARE,
ASMATHEVAL.public static boolean isOtherQueryType(java.lang.String queryType)
queryType - the query type to check.QueryConst.EXISTS, NOTEXISTS, FILENAME.public static boolean isPatternType(java.lang.String constraintType)
constraintType - the constraint type.public static boolean isSearchType(java.lang.String searchType)
searchType - the search type.public static boolean isRangeConstraint(java.lang.String constraintType)
constraintType - the constraint type.public static boolean isSingleConstraint(java.lang.String constraintType)
QueryConst.EXISTS value.constraintType - the constraint type.public static boolean isNumericalConstraint(java.lang.String constraintType)
constraintType - the constraint type.protected boolean isStartConstraint(java.lang.String constraintType)
constraintType - the constraint type.protected boolean isEndConstraint(java.lang.String constraintType)
constraintType - the constraint type.protected boolean isCurrencyChar(char theChar)
theChar - the character to evaluate.public static boolean allowsCase(java.lang.String queryType)
queryType - the query type.public static boolean allowsWildcards(java.lang.String constraintType)
constraintType - the constraint type.public static boolean constraintNeedsValue(java.lang.String constraintType)
constraintType - the constraint type.public static boolean constraintIsAttribute(java.lang.String constraintType)
constraintType - the constraint type.public static java.lang.String getCorrectTextType(java.lang.String queryType,
java.lang.String constraintType)
TEXT)
or pattern-based text (ASTEXT).queryType - the current type. Might not be changed.constraintType - the constraint type.public static java.util.ArrayList<java.lang.String> getConstraintTypes(java.lang.String queryType,
java.lang.String queryState,
boolean includeWildcards)
queryType - the type of query - ASTEXT, ASXML, NUMERICAL or HIGHLIGHT.
If set to null, then the most basic text comparison set is returned,
without any of the new options of this package.queryState - the current construction state of the query. Can be null.includeWildcards - true if wildcard characters are included.public static java.util.ArrayList<java.lang.String> getTextTypes()
public static java.util.ArrayList<java.lang.String> getComparisonOps(boolean equivalenceOnly)
equivalenceOnly - true if return the equivalence operator only.public static java.util.ArrayList<java.lang.String> getLogicalOps()
public static java.lang.String getReciprocalComparison(java.lang.String comparison)
LT would return a GT.comparison - the comparison operator.