MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / equalsMask

Method equalsMask

src/main/java/net/optifine/util/StrUtils.java:9–83  ·  view source on GitHub ↗
(String str, String mask, char wildChar, char wildCharSingle)

Source from the content-addressed store, hash-verified

7public class StrUtils
8{
9 public static boolean equalsMask(String str, String mask, char wildChar, char wildCharSingle)
10 {
11 if (mask != null && str != null)
12 {
13 if (mask.indexOf(wildChar) < 0)
14 {
15 return mask.indexOf(wildCharSingle) < 0 ? mask.equals(str) : equalsMaskSingle(str, mask, wildCharSingle);
16 }
17 else
18 {
19 List list = new ArrayList();
20 String s = "" + wildChar;
21
22 if (mask.startsWith(s))
23 {
24 list.add("");
25 }
26
27 StringTokenizer stringtokenizer = new StringTokenizer(mask, s);
28
29 while (stringtokenizer.hasMoreElements())
30 {
31 list.add(stringtokenizer.nextToken());
32 }
33
34 if (mask.endsWith(s))
35 {
36 list.add("");
37 }
38
39 String s1 = (String)list.get(0);
40
41 if (!startsWithMaskSingle(str, s1, wildCharSingle))
42 {
43 return false;
44 }
45 else
46 {
47 String s2 = (String)list.get(list.size() - 1);
48
49 if (!endsWithMaskSingle(str, s2, wildCharSingle))
50 {
51 return false;
52 }
53 else
54 {
55 int i = 0;
56
57 for (int j = 0; j < ((List)list).size(); ++j)
58 {
59 String s3 = (String)list.get(j);
60
61 if (s3.length() > 0)
62 {
63 int k = indexOfMaskSingle(str, s3, i, wildCharSingle);
64
65 if (k < 0)
66 {

Callers 1

matchesPatternMethod · 0.95

Calls 12

equalsMaskSingleMethod · 0.95
startsWithMaskSingleMethod · 0.95
endsWithMaskSingleMethod · 0.95
indexOfMaskSingleMethod · 0.95
startsWithMethod · 0.80
endsWithMethod · 0.80
lengthMethod · 0.80
getMethod · 0.65
indexOfMethod · 0.45
equalsMethod · 0.45
addMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected