org.eclipse.xtext.ui.editor.outline.quickoutline
Class StringMatcher

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.outline.quickoutline.StringMatcher
Direct Known Subclasses:
PrefixMatcherOutlineAdapter

public class StringMatcher
extends java.lang.Object

Matches a given String against a prefix pattern. The matching algorithm will return true if the tested string starts with the given pattern. The pattern suppors wildcards such as * and ?.

Author:
Peter Friese - Initial contribution and API, Sebastian Zarnekow - Javadoc, minor fixes to the matching algorithm

Constructor Summary
StringMatcher(java.lang.String pattern, boolean ignoreCase)
           
 
Method Summary
protected  java.util.regex.Pattern getPattern()
           
 boolean match(java.lang.String text)
           
protected  java.lang.String translatePattern(java.lang.String pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringMatcher

public StringMatcher(java.lang.String pattern,
                     boolean ignoreCase)
Method Detail

translatePattern

protected java.lang.String translatePattern(java.lang.String pattern)
Since:
2.1

getPattern

protected java.util.regex.Pattern getPattern()
Since:
2.1 protected

match

public boolean match(java.lang.String text)