public final class CharOperation extends Object
| Constructor and Description |
|---|
CharOperation() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
match(char[] pattern,
char[] name,
boolean isCaseSensitive)
Answers true if the pattern matches the given name, false otherwise.
|
static boolean |
prefixEquals(char[] prefix,
char[] name,
boolean isCaseSensitive)
Answers true if the given name starts with the given prefix, false otherwise.
|
public static final boolean match(char[] pattern,
char[] name,
boolean isCaseSensitive)
pattern = { '?', 'b', '*' }
name = { 'a', 'b', 'c' , 'd' }
isCaseSensitive = true
result => true
pattern = { '?', 'b', '?' }
name = { 'a', 'b', 'c' , 'd' }
isCaseSensitive = true
result => false
pattern = { 'b', '*' }
name = { 'a', 'b', 'c' , 'd' }
isCaseSensitive = true
result => false
pattern - the given patternname - the given nameisCaseSensitive - flag to know whether or not the matching should be case
sensitivepublic static final boolean prefixEquals(char[] prefix,
char[] name,
boolean isCaseSensitive)
prefix = { 'a' , 'B' }
name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
isCaseSensitive = false
result => true
prefix = { 'a' , 'B' }
name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
isCaseSensitive = true
result => false
prefix - the given prefixname - the given nameisCaseSensitive - to find out whether or not the comparison should be case sensitiveNullPointerException - if the given name is null or if the given prefix is nullCopyright © 2018 JBoss by Red Hat. All rights reserved.