| java.lang.Object org.cougaar.community.Glob
Glob | public class Glob (Code) | | Matches unix-style glob patterns
|
Inner Class :public interface Segment | |
match | public boolean match(String s)(Code) | | Check if a string matches the pattern. The procedure is to step
through the segments in sequence and see if the segment matches
the beginning of the current string. If it doesn't return false
(failure). If it does, trim off the matched characters and
repeat for the next segment. Each segment specifies the minimum
and maximum characters that it can match. If the maximum
exceeds the minimum, all possibilities are tested starting with
the longest (maximum number of character) until a match is
achieved. If all the possibilities fail, then this method
fails.
Parameters: s - the string to test true if a match |
parse | public static synchronized Glob parse(String pattern)(Code) | | Parse a glob pattern or find the previously parsed result. In
glob patterns:
- *
- matches any number of any character
- ?
- matches a single character
- [...]
- Matches any single character in the enclosed
list(s) or range(s). A list is a string of characters. A range
is two characters separated by a dash (-), and includes all the
characters in between in the collating sequence of the default
charset. To include a ']' in the set, put it first. To include
a '-', put it first or last.
Parameters: pattern - the pattern to parse. the parsed result. The match method of the returnedobject should be used to check if any given string matches thepattern that was parsed. |
toString | public String toString()(Code) | | Convert the parsed pattern to a string
String representation of parsed pattern |
|
|