Package fr.neatmonster.nocheatplus.utilities.ds.prefixtree

Examples of fr.neatmonster.nocheatplus.utilities.ds.prefixtree.SimpleCharPrefixTree$SimpleCharLookupEntry


     * @param config
     * @param removePaths
     * @return
     */
  public static ConfigFile removePaths(final ConfigFile config, final Collection<String> removePaths) {
      final SimpleCharPrefixTree prefixes = new SimpleCharPrefixTree();
      for (final String path : removePaths){
        prefixes.feed(path);
      }
      final ConfigFile newConfig = new ConfigFile();
      for (final Entry<String, Object> entry : config.getValues(true).entrySet()){
        final String path = entry.getKey();
        final Object value = entry.getValue();
        if (value instanceof ConfigurationSection){
          continue;
        }
        if (!prefixes.hasPrefix(path)){
          newConfig.set(path, value);
        }
      }
    return newConfig;
  }
View Full Code Here


      "opp", "opp dummy", "op dummy2", "ncp", "ncp dummy"
      );

  @Test
  public void testPrefixWords(){
    SimpleCharPrefixTree tree = new SimpleCharPrefixTree();
    tree.feedAll(feed, false, true);
    for (String input : mustFind){
      if (!tree.hasPrefixWords(input)){
        fail("Expect to be matched: '" + input + "'");
      }
    }
    for (String input : mustNotFind){
      if (tree.hasPrefixWords(input)){
        fail("Expect not to be matched: '" + input + "'");
      }
    }
  }
View Full Code Here

TOP

Related Classes of fr.neatmonster.nocheatplus.utilities.ds.prefixtree.SimpleCharPrefixTree$SimpleCharLookupEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.