MCPcopy Create free account
hub / github.com/M66B/FairEmail / contains

Method contains

app/src/main/java/eu/faircode/email/HtmlHelper.java:3417–3445  ·  view source on GitHub ↗
(Document d, String[] texts)

Source from the content-addressed store, hash-verified

3415 }
3416
3417 static boolean contains(Document d, String[] texts) {
3418 Map<String, Boolean> condition = new HashMap<>();
3419 for (String t : texts)
3420 condition.put(t, false);
3421
3422 for (Element elm : d.body().select("*"))
3423 for (Node child : elm.childNodes()) {
3424 if (child instanceof TextNode) {
3425 TextNode tnode = ((TextNode) child);
3426 String text = tnode.getWholeText();
3427 for (String t : texts)
3428 if (!condition.get(t) && text.contains(t)) {
3429 condition.put(t, true);
3430
3431 boolean found = true;
3432 for (String c : texts)
3433 if (!condition.get(c)) {
3434 found = false;
3435 break;
3436 }
3437
3438 if (found)
3439 return true;
3440 }
3441 }
3442 }
3443
3444 return false;
3445 }
3446
3447 static SpannableStringBuilder fromDocument(
3448 Context context, @NonNull Document document,

Callers 15

onExecuteMethod · 0.95
onExecuteMethod · 0.45
detectMethod · 0.45
onChangedMethod · 0.45
logMethod · 0.45
onExecuteMethod · 0.45
onCreateDialogMethod · 0.45
connectMethod · 0.45
getFoldersMethod · 0.45
configureMethod · 0.45

Calls 4

bodyMethod · 0.80
selectMethod · 0.65
putMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected