Package com.day.text
Class GlobPattern
java.lang.Object
com.day.text.GlobPattern
The
GlobPattern implements matching operations that do a
pattern globbing.-
Constructor Summary
ConstructorsConstructorDescriptionGlobPattern(String pattern) Class constructor that create aGlobPatternwith the given pattern.GlobPattern(String pattern, boolean ishandle) Class constructor that create aGlobPatternwith the given pattern. -
Method Summary
Modifier and TypeMethodDescriptionstatic final booleanReturnstrueif the string contains wildcards.booleanReturnstrueifthisGlobPatternis equal to objectobj.inthashCode()Returns the hashCode for thisGlobPattern.static final intReturns the index of the first wildcard character in the string or-1if the string does not contain a wild card character.final booleanReturns a flag indicating whether a string matches this pattern.static final booleanReturns a flag indicating whether a string matches a pattern.static final booleanReturns a flag indicating whether a string matches a pattern.booleanReturns a flag indicating whether a string matches a pattern.booleanshellMatches(String s, char c) Returns a flag indicating whether a string matches a pattern.toString()Returns the pattern of thisGlobPattern
-
Constructor Details
-
GlobPattern
Class constructor that create aGlobPatternwith the given pattern. If theishandleflag istruethis will construct a hierarchy matcher.- Parameters:
pattern- pattern stringishandle- iftrueand the pattern contains no wildcards, thematches(String)returns true, if the compared string is equal or starts with the pattern+"/" (i.e. is a child page)
-
GlobPattern
Class constructor that create aGlobPatternwith the given pattern.- Parameters:
pattern- pattern string
-
-
Method Details
-
matches
Returns a flag indicating whether a string matches this pattern.- Parameters:
s- string to be checked- Returns:
trueif s matches this pattern, elsefalse.
-
matches
Returns a flag indicating whether a string matches a pattern.- Parameters:
pattern- pattern used for comparisons- string to be checked- Returns:
trueif s matches pattern, elsefalse.
-
matches
Returns a flag indicating whether a string matches a pattern. if the ishandle istrueand the pattern contains no wildcards, the method returns true, if the pattern is a hierarchical father of the string.- Parameters:
pattern- pattern used for comparisons- string to be checkedishandle- flag, indicating, if a handle comparison has to be performed- Returns:
trueif s matches pattern, elsefalse.
-
shellMatches
Returns a flag indicating whether a string matches a pattern. unlike thematchesmethods, this matching is done shell-like.- Parameters:
s- string to be checked- Returns:
trueif the string matches shell-like;falseotherwise.
-
shellMatches
Returns a flag indicating whether a string matches a pattern. unlike thematchesmethods, this matching is done shell-like.- Parameters:
s- string to be checkedc- character to be used as path delimiter- Returns:
trueif the string matches shell-like;falseotherwise.
-
containsWildcards
Returnstrueif the string contains wildcards.- Parameters:
s- string to be checked- Returns:
trueif s contains wildcards, elsefalse.
-
indexOfWildcard
Returns the index of the first wildcard character in the string or-1if the string does not contain a wild card character.- Parameters:
s- string to be checked
-
toString
Returns the pattern of thisGlobPattern -
equals
ReturnstrueifthisGlobPatternis equal to objectobj. -
hashCode
public int hashCode()Returns the hashCode for thisGlobPattern.
-