com.sun.faban.driver.util
Class StringMatcher

java.lang.Object
  extended by 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

Constructor Summary
StringMatcher(String[] candidates)
          Constructs a StringMatcher instance.
 
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
 

Constructor Detail

StringMatcher

public StringMatcher(String[] candidates)
Constructs a StringMatcher instance.

Parameters:
candidates - the candidates to match
Method Detail

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