Class IntArrayTrie<V>

java.lang.Object
com.simibubi.create.foundation.recipe.trie.IntArrayTrie<V>

public class IntArrayTrie<V> extends Object
A one-to-many, lookup-optimized data structure for storing int[] -> V mappings, which provides subset-to-many lookup.
  • Constructor Details

    • IntArrayTrie

      public IntArrayTrie()
  • Method Details

    • getMaxDepth

      public int getMaxDepth()
    • getNodeCount

      public int getNodeCount()
    • getValueCount

      public int getValueCount()
    • insert

      public void insert(int[] key, V value)
      Insert a key-value pair into the trie.
      Parameters:
      key - a sorted array of integers
      value - the value to associate with the key
    • lookup

      public List<V> lookup(it.unimi.dsi.fastutil.ints.IntSet pool)
      Look up all values associated with a subset of pool.
      Parameters:
      pool - the set of allowable keys. It SHOULD have O(1) lookup time.
      Returns:
      all associated values
    • toString

      public String toString()
      Overrides:
      toString in class Object