|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.util.ExpandablePattern
public class ExpandablePattern
A pattern (regular expression) that can return the set of strings it matches. See the JavaDoc for java.util.regex.Pattern for details of regexp syntax.
Field Summary | |
---|---|
protected static java.lang.Exception |
EXPANSION_SET_TOO_BIG
|
static int |
MAX_EXPANSION
|
Constructor Summary | |
---|---|
ExpandablePattern(java.lang.String pattern)
Constructs a new ExpandablePattern that uses a specified regular expression. |
|
ExpandablePattern(java.lang.String pattern,
boolean glob)
Constructs a new ExpandablePattern that uses a specified regular expresion or Glob-style pattern. |
Method Summary | |
---|---|
java.util.HashSet |
expand()
Returns the set of strings that a specified regular expression matches. |
static java.util.HashSet |
expand(java.lang.String regexp)
Returns the set of strings that a specified regular expression matches. |
static java.util.HashSet |
expand(java.lang.String regexp,
java.util.HashSet prepend)
Returns the set of strings that a specified regular expression matches. |
protected static java.util.HashSet |
expandCharSet(java.lang.String charSet)
Returns the set of strings that a specified character set matches. |
static void |
main(java.lang.String[] args)
Interactive test program for Expandable pattern. |
boolean |
matches(java.lang.String s)
Returns true iff this pattern matches s. |
java.lang.String |
toString()
Returns a regular expression that matches the same strings as this pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_EXPANSION
protected static final java.lang.Exception EXPANSION_SET_TOO_BIG
Constructor Detail |
---|
public ExpandablePattern(java.lang.String pattern)
pattern
- the regular expression to use in matchespublic ExpandablePattern(java.lang.String pattern, boolean glob)
pattern
- the pattern to use in matchesglob
- if true, the specified pattern is Glob-style (* and ?
wildcards; . not special); otherwise, it's a regular expression.Method Detail |
---|
public java.util.HashSet expand() throws java.lang.Exception
java.lang.Exception
- if the set is too largepublic boolean matches(java.lang.String s)
s
- the string to test
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.HashSet expand(java.lang.String regexp) throws java.lang.Exception
regexp
- the regular expression to expand.
java.lang.Exception
- if the set is too largepublic static java.util.HashSet expand(java.lang.String regexp, java.util.HashSet prepend) throws java.lang.Exception
regexp
- the regular expression to expand.prepend
- a set of strings to prepend to each string generated by
the regular expression
java.lang.Exception
- if the set is too largeprotected static java.util.HashSet expandCharSet(java.lang.String charSet) throws java.lang.Exception
charSet
- the character set to expand, not including enclosing []
java.lang.Exception
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |