net.sourceforge.wurfl.core.handlers.matchers.strategy
Class RISMatcher

java.lang.Object
  extended by net.sourceforge.wurfl.core.handlers.matchers.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 432 2010-05-06 12:12:53Z filippo.deluca $
Author:
Fantayeneh Asres Gizaw, Filippo De Luca

Field Summary
static RISMatcher INSTANCE
          Singleton instance
 
Method Summary
 String getName()
           
 String match(SortedSet 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()

match

public String match(SortedSet 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 SortedSet 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 © 2008-2010 WURFL-Pro srl. All Rights Reserved.