public class SearchHelper
extends java.lang.Object
Constructor and Description |
---|
SearchHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Integer |
extractPart(java.lang.StringBuilder term)
Used to get a part number for the search term
|
static boolean |
hasStripTokens(java.util.List<java.util.regex.Pattern> stripTokens,
java.lang.StringBuilder term)
Used to check if a search term has tokens that can be stripped
|
static void |
removeStripTokens(java.util.List<java.util.regex.Pattern> stripTokens,
java.lang.StringBuilder term)
Used to strip tokens that should be ignored from a search term
|
static void |
removeUnwantedCharacters(java.lang.StringBuilder term)
This is used to remove any unwanted characters from search terms
|
static void |
replaceDots(java.lang.StringBuilder term)
This is a helper method that will replace the dot's sometimes found in place of spaces of filenames.
|
static void |
replaceHyphens(java.lang.StringBuilder term)
This is used to replace hyphens characters with spaces in the search term
|
static void |
replaceUnderscore(java.lang.StringBuilder term)
This is used to replace underscore characters with spaces in the search term
|
static void |
replaceWithSpaces(java.lang.StringBuilder term)
This is used to replace word seperator characters such as underscores with spaces.
|
static void |
trimRubishFromEnds(java.lang.StringBuilder term)
Used to strip white space from either end of the search terms
|
public static void replaceDots(java.lang.StringBuilder term)
term
- The term that might contains dot's instead of spaces. This buffer will have the dot's
replaced.public static void removeUnwantedCharacters(java.lang.StringBuilder term)
term
- The search termpublic static void replaceUnderscore(java.lang.StringBuilder term)
term
- The search termpublic static void replaceHyphens(java.lang.StringBuilder term)
term
- The search termpublic static void replaceWithSpaces(java.lang.StringBuilder term)
term
- The search termpublic static java.lang.Integer extractPart(java.lang.StringBuilder term)
term
- The search termpublic static void removeStripTokens(java.util.List<java.util.regex.Pattern> stripTokens, java.lang.StringBuilder term)
stripTokens
- The tokens to stripterm
- The search termpublic static boolean hasStripTokens(java.util.List<java.util.regex.Pattern> stripTokens, java.lang.StringBuilder term)
term
- The search termstripTokens
- The tokens to check forpublic static void trimRubishFromEnds(java.lang.StringBuilder term)
term
- The search term