de.fhg.igd.util
Class Pattern

java.lang.Object
  extended by de.fhg.igd.util.Pattern

public class Pattern
extends Object

This class provides a very simple pattern matching algorithm. Its method matches can be used instead of javax.util.regex.Pattern's from JDK runtime environment (Version >= 1.4), to generate byte code, which is compatible to the JDK runtime environment (Version < 1.4). This class does NOT provide regular expression matching, but only a very small subset. It should only be used in cases, when JDK (Version >= 1.4) is not available on the current device!

Version:
"$Id: Pattern.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters

Constructor Summary
Pattern()
           
 
Method Summary
static boolean matches(String exStr, String str)
          Compares the given string str to the given extended string exStr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pattern

public Pattern()
Method Detail

matches

public static boolean matches(String exStr,
                              String str)
Compares the given string str to the given extended string exStr.

The extended string can have following format: (<CHAR%gt;|'?')* ('*')?

Whereas <CHAR> matches the given character in str, '?' matches any character in str and '*' matches an arbitrary suffix in str.

Parameters:
exStr - The extented string str should be compared to.
str - The string to be matched.
Returns:
true if, and only if, str matches exStr.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.