Example #1
0
    private boolean isMatch(Note n, String t) {
      if (matches.get(n) != null) {
        return true;
      }

      String lbl = n.getLabel().toLowerCase();
      if (lbl.startsWith(t) || n.getKeywords().contains(t)) {
        matches.put(n, t);

        return true;
      }

      List<Note> l = n.getChildren();
      for (Note note : l) {
        if (isMatch(note, t)) {
          matches.put(n, t);
          return true;
        }
      }
      return false;
    }