|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.search.parse.CustomTokenizer
public class CustomTokenizer
Our command line parsing is a little specialized, so StringTokenizer is not up to the job. The specific problem is that there is sometimes no separator between parts of the command, and since this is specialized we also leave the results in a Vector of SearchWords.
Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors. |
Licence
Field Summary | |
---|---|
private static int |
CHAR_COMMAND
The type of character (see charType) |
private static int |
CHAR_PARAM
The type of character (see charType) |
private static int |
CHAR_SPACE
The type of character (see charType) |
Constructor Summary | |
---|---|
private |
CustomTokenizer()
Prevent Instansiation |
Method Summary | |
---|---|
private static void |
addWord(List output,
Map commands,
String word)
Convenience function to add a Word to the Vector being created. |
private static int |
charType(char sought,
String commands)
What class of character is this? |
private static String |
getSingleCharWords(Map commands)
Convenience function to add a Word to the Vector being created. |
static List |
tokenize(String sought,
Map commands)
Convenience method to generate a Vector of SearchWords |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int CHAR_PARAM
private static final int CHAR_COMMAND
private static final int CHAR_SPACE
Constructor Detail |
---|
private CustomTokenizer()
Method Detail |
---|
public static List tokenize(String sought, Map commands) throws BookException
sought
- The text to parsecommands
- The Hashtable of SearchWords to select from
BookException
private static final int charType(char sought, String commands)
sought
- The string to be searched for
private static void addWord(List output, Map commands, String word)
output
- The Vector to altercommands
- The Word sourceword
- The trigger to look forprivate static String getSingleCharWords(Map commands)
commands
- The Word source
|
Copyright ? 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |