Class BambooStringUtils.AffixFilteringTree

  • Enclosing class:
    BambooStringUtils

    public static class BambooStringUtils.AffixFilteringTree
    extends Object
    Class represent efficient way of filtering a set of strings with respect to a prefix or suffix. For example: AffixFilteringTree tree = new AffixFilteringTree(ImmutableList.of("abc", "abd", "cbc")); tree.getWithPrefix("ab"); // [abc, abd] tree.getWithSuffix("bc"); // [abc, cbc]
    • Constructor Detail

      • AffixFilteringTree

        public AffixFilteringTree​(@NotNull
                                  @NotNull Iterable<String> iterable)
    • Method Detail

      • getWithPrefix

        @NotNull
        public @NotNull Iterable<String> getWithPrefix​(@NotNull
                                                       @NotNull String prefix)
      • getWithSuffix

        @NotNull
        public @NotNull Iterable<String> getWithSuffix​(@NotNull
                                                       @NotNull String suffix)