net.sourceforge.wurfl.core.strategy
Class RISMatcher

java.lang.Object
  extended by net.sourceforge.wurfl.core.strategy.RISMatcher
All Implemented Interfaces:
StringMatcher

public final class RISMatcher
extends Object
implements StringMatcher

Singleton class applying RIS matcher strategy.

Searches for the string which has the longest common substring with the given key

Version:
$Id: RISMatcher.java 934 2012-03-27 13:34:26Z fulvio.crivellaro $

Field Summary
static RISMatcher INSTANCE
          Singleton instance
 
Method Summary
 String getName()
           
 String match(Set<String> candidates, String needle, int tolerance)
          Searches for the string which has the longest common substring with the given needle.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final RISMatcher INSTANCE
Singleton instance

Method Detail

getName

public String getName()
Specified by:
getName in interface StringMatcher

match

public String match(Set<String> candidates,
                    String needle,
                    int tolerance)
Searches for the string which has the longest common substring with the given needle. If there is not candidates within given tolerance, it returns null.

Specified by:
match in interface StringMatcher
Parameters:
candidates - The Set of possible candidates.
needle - The String to match.
tolerance - the tolerance between needle and candidates.
Returns:
Matched candidate String.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 ScientiaMobile Inc.. All Rights Reserved.