|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.lucene.SubQueryParser
public class SubQueryParser
This class behaves as a helper class to the QueryParser and provides various methods which are called from various methods of QueryParser.
| Constructor Summary | |
|---|---|
SubQueryParser()
|
|
| Method Summary | |
|---|---|
private static ArrayList<String> |
duplicate(ArrayList<String> queries,
String s,
int dupliSize,
int no)
This is a helper method that helps in duplicating the provided tokens. |
private static String |
extractWildcards(String query)
This method, interprets the wild cards and convert query accordingly. |
private static int |
findBracketClosingPosition(int startFrom,
String query)
Returns the position of a closing bracket. |
static ArrayList<String> |
findOrTokens(String query)
This method given a query identifies the OR Tokens for eg. |
private static String |
findWildCardString(int brClPos,
String query)
Method retrieves wild card characters after the closing bracket. |
private static boolean |
isClosingBracket(char ch,
char pre)
Returns if the character is bracket used to mark boundary of a token or an escape character. |
private static boolean |
isOpenBracket(char ch,
char pre)
Returns if the character is bracket used to mark boundary of a token or an escape character. |
private static boolean |
isOrSym(char ch,
char pre)
Returns if the character is an OR symbol used as a logical operator or an escape character. |
static void |
main(String[] args)
|
static ArrayList<String> |
parseQuery(String q1)
this method parses the query and returns the different queries converted into the OR normalized form for e.g. |
static boolean |
scanQueryForOrOrBracket(String query)
This method checks if query has either | or ( in it. |
private static ArrayList<String> |
writeCharInAll(char c,
int no,
ArrayList<String> queries)
Helps in duplicating a character in the provided queries |
private static ArrayList<String> |
writeStringInAll(String c,
int no,
ArrayList<String> queries)
Helps in duplicating a string in the provided queries |
private static ArrayList<String> |
writeTokens(ArrayList<String> tokens,
ArrayList<String> queries,
int dupliSize)
This is a helper method that helps in duplicating the provided tokens. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubQueryParser()
| Method Detail |
|---|
public static void main(String[] args)
private static String findWildCardString(int brClPos,
String query)
brClPos - query -
private static String extractWildcards(String query)
throws SearchException
query -
SearchException
public static ArrayList<String> parseQuery(String q1)
throws SearchException
q1 -
SearchExceptionpublic static boolean scanQueryForOrOrBracket(String query)
query -
private static ArrayList<String> writeTokens(ArrayList<String> tokens,
ArrayList<String> queries,
int dupliSize)
tokens - queries - dupliSize -
private static ArrayList<String> duplicate(ArrayList<String> queries,
String s,
int dupliSize,
int no)
public static ArrayList<String> findOrTokens(String query)
query -
private static int findBracketClosingPosition(int startFrom,
String query)
startFrom - query -
private static ArrayList<String> writeCharInAll(char c,
int no,
ArrayList<String> queries)
c - no - queries -
private static ArrayList<String> writeStringInAll(String c,
int no,
ArrayList<String> queries)
c - no - queries -
private static boolean isOpenBracket(char ch,
char pre)
ch - pre -
private static boolean isClosingBracket(char ch,
char pre)
ch - pre -
private static boolean isOrSym(char ch,
char pre)
ch - pre -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||