lexx.utils
Class StringSearch

java.lang.Object
  |
  +--lexx.utils.StringSearch

public final class StringSearch
extends java.lang.Object

Static Factory class that performs useful takes on Strings, such as if it contains a certain word or character

Copyright (c) 2002-2003

Since:
20/03/2003
Version:
1.0
Author:
Mohammed Imran

Constructor Summary
StringSearch()
           
 
Method Summary
static boolean contains(char c, java.lang.String data)
           
static boolean contains(java.lang.String find, java.lang.String data)
           
static boolean containsChar(java.lang.String listOfChar, java.lang.String data)
           
static java.lang.String generateRandomKey()
           
static java.lang.String[] getBlock(java.lang.String startBlock, java.lang.String endBlock, java.lang.String data)
          This grabs a block data from a string, aimed to be used to find things like javadoc, not for find { }
static java.lang.String getFirstWord(java.lang.String data)
           
static java.lang.String[] getWord(java.lang.String[] words, java.lang.String data)
           
(package private) static java.lang.String[] getWord(java.lang.String word, java.lang.String data)
           
(package private) static java.lang.String[] searchString(java.lang.String[] find, java.lang.String data)
          This can be easily optimised
static java.lang.String[] searchString(java.lang.String[] find, java.lang.String[] exclude, java.lang.String data)
           
static java.lang.String[] searchString(java.lang.String[] find, java.lang.String[] exStartBlock, java.lang.String[] exEndBlock, java.lang.String data)
           
(package private) static java.lang.String[] searchString(java.lang.String find, java.lang.String data)
          This method searches a string for some certain characters
(package private) static java.lang.String[] searchString(java.lang.String find, java.lang.String[] exclude, java.lang.String data)
           
(package private) static java.lang.String[] searchString(java.lang.String find, java.lang.String[] exStartBlock, java.lang.String[] exEndBlock, java.lang.String data)
           
(package private) static java.lang.String[] searchStringIgnoreCase(java.lang.String find, java.lang.String data)
          This method searches a string for some certain characters irrespective if it is upper or lowercase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringSearch

public StringSearch()
Method Detail

getFirstWord

public static java.lang.String getFirstWord(java.lang.String data)

searchString

static java.lang.String[] searchString(java.lang.String find,
                                       java.lang.String[] exclude,
                                       java.lang.String data)

searchString

static java.lang.String[] searchString(java.lang.String find,
                                       java.lang.String[] exStartBlock,
                                       java.lang.String[] exEndBlock,
                                       java.lang.String data)

searchString

public static java.lang.String[] searchString(java.lang.String[] find,
                                              java.lang.String[] exStartBlock,
                                              java.lang.String[] exEndBlock,
                                              java.lang.String data)

generateRandomKey

public static java.lang.String generateRandomKey()

searchString

static java.lang.String[] searchString(java.lang.String find,
                                       java.lang.String data)
This method searches a string for some certain characters

Parameters:
find - refers to the String that you are looking for
data - refers to the String which contains your data
Returns:
String[0] returns the fist occerance of the string + including the characters String[1] returns the rest of the string Note if method can't find string then Sting[1] will be empty

contains

public static boolean contains(java.lang.String find,
                               java.lang.String data)

contains

public static boolean contains(char c,
                               java.lang.String data)

containsChar

public static boolean containsChar(java.lang.String listOfChar,
                                   java.lang.String data)

searchString

public static java.lang.String[] searchString(java.lang.String[] find,
                                              java.lang.String[] exclude,
                                              java.lang.String data)

searchString

static java.lang.String[] searchString(java.lang.String[] find,
                                       java.lang.String data)
This can be easily optimised


searchStringIgnoreCase

static java.lang.String[] searchStringIgnoreCase(java.lang.String find,
                                                 java.lang.String data)
This method searches a string for some certain characters irrespective if it is upper or lowercase

Parameters:
find - refers to the String that you are looking for
data - refers to the String which contains your data
Returns:
String[0] returns the fist occerance of the string + including the characters String[1] returns the rest of the string Note if method can't find string then Sting[1] will be empty

getBlock

public static java.lang.String[] getBlock(java.lang.String startBlock,
                                          java.lang.String endBlock,
                                          java.lang.String data)
This grabs a block data from a string, aimed to be used to find things like javadoc, not for find { }

Parameters:
startBlock - refers the starting characters that would be found at the starting block
endBlock - refers to the end of the characters that would be found in the end of the block
data - refers to the data that you are going to search through
Returns:
String[0] returns all the string found before the block String[1] returns the block of string including startBlock and endBlock String[2] returns the remaining string after the block Note if block is not found both String[1] and String[2] will be empty

getWord

static java.lang.String[] getWord(java.lang.String word,
                                  java.lang.String data)

getWord

public static java.lang.String[] getWord(java.lang.String[] words,
                                         java.lang.String data)