All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.lirmm.graphik.util.collections.Trie Maven / Gradle / Ivy

The newest version!
package fr.lirmm.graphik.util.collections;

public class Trie
{
   private TrieNode root;
   
   /**
    * Constructor
    */
   public Trie()
   {
      root = new TrieNode();
   }
   
   /**
    * Associates a value to a word
    * 
    * @param value
    * @param word
    */
   @SafeVarargs
   public final V put(V value, T... word)
   {
      return root.put(value, 0, word);
   }
   
   /**
    * Get the value in the Trie with the given
    * word
    * 
    * @param word
    * @return the associated value, or null if there is no value associated.
    */
   @SafeVarargs
   public final V get(T... word)
   {
      return root.get(0, word);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy