astex
Class match

java.lang.Object
  extended by astex.match

public class match
extends java.lang.Object

Instances of this class represents a wildcard expression, which can be matched against String objects. This class also provides static methods for matching wildcard expressions. The following matching "features" are supported:


Field Summary
static int ALL
          All possible matching features.
static int ASTERISK
          This flag represents the asterisk (`*') wildcard character.
static int BACKSLASH
          This flag represents escaping feature, using backslash (`\').
static int BRACKETS
          This flag represents the bracket (`[..]') matching feature.
static int DEFAULT
          The default matching constructs (ASTERISK, QUESTION_MARK, and BRACKETS).
static int QUESTION_MARK
          This flag represents the question mark (`?') wildcard character.
 
Constructor Summary
match()
           
 
Method Summary
static void main(java.lang.String[] args)
          Test method for the matcher.
static boolean matches(java.lang.String pattern, java.lang.String string)
          Return true if string matches pattern.
static boolean matches(java.lang.String pattern, java.lang.String string, int flags)
          Return true if string matches pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASTERISK

public static final int ASTERISK
This flag represents the asterisk (`*') wildcard character.

See Also:
Constant Field Values

QUESTION_MARK

public static final int QUESTION_MARK
This flag represents the question mark (`?') wildcard character.

See Also:
Constant Field Values

BRACKETS

public static final int BRACKETS
This flag represents the bracket (`[..]') matching feature.

See Also:
Constant Field Values

BACKSLASH

public static final int BACKSLASH
This flag represents escaping feature, using backslash (`\').

See Also:
Constant Field Values

ALL

public static final int ALL
All possible matching features.

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
The default matching constructs (ASTERISK, QUESTION_MARK, and BRACKETS).

See Also:
Constant Field Values
Constructor Detail

match

public match()
Method Detail

matches

public static boolean matches(java.lang.String pattern,
                              java.lang.String string)
Return true if string matches pattern.


matches

public static boolean matches(java.lang.String pattern,
                              java.lang.String string,
                              int flags)
Return true if string matches pattern.

Parameters:
pattern - Wildcard pattern.
string - String to match.
flags - Logical OR of allowed matching features.

main

public static void main(java.lang.String[] args)
Test method for the matcher.