com.sun.faban.driver.util
Class StringMatcher
java.lang.Object
com.sun.faban.driver.util.StringMatcher
public class StringMatcher
- extends Object
Tool to choose the matching string out of a list of strings.
The current implementation sequentially matches the strings
but this can be reimplemented with a more efficient algorithm.
- Author:
- Akara Sucharitakul
Method Summary |
int |
match(Object match)
Matches the string to the candidates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringMatcher
public StringMatcher(String[] candidates)
- Constructs a StringMatcher instance.
- Parameters:
candidates
- the candidates to match
match
public int match(Object match)
- Matches the string to the candidates.
- Parameters:
match
- object to match
- Returns:
- index of the match in the candidate array or -1 if not found