Skip to content

Commit c1d48ca

Browse files
javadoc CompositeStringMultiTrie
1 parent 25bfe59 commit c1d48ca

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

enigma/src/main/java/org/quiltmc/enigma/util/multi_trie/CompositeStringMultiTrie.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,41 @@
66
import java.util.Map;
77
import java.util.function.Supplier;
88

9+
/**
10+
* A {@link StringMultiTrie} that allows customization of nodes' backing data structures.
11+
*
12+
* @param <V> the type of values
13+
*
14+
* @see #of(Supplier, Supplier)
15+
* @see #createHashed()
16+
*/
917
public final class CompositeStringMultiTrie<V> extends StringMultiTrie<V, CompositeStringMultiTrie.Branch<V>> {
1018
private final Root<V> root;
1119
private final View view = new View();
1220

21+
/**
22+
* Creates a trie with nodes whose branches are held in {@link HashMap}s
23+
* and whose leaves are held in {@link HashSet}s.
24+
*
25+
* @param <V> the type of values stored in the created trie
26+
*
27+
* @see #of(Supplier, Supplier)
28+
*/
1329
public static <V> CompositeStringMultiTrie<V> createHashed() {
1430
return of(HashMap::new, HashSet::new);
1531
}
1632

33+
/**
34+
* Creates a trie with nodes whose branches are held in maps created by the passed {@code branchesFactory}
35+
* and whose leaves are held in collections created by the passed {@code leavesFactory}.
36+
*
37+
* @param branchesFactory a pure method that creates a new, empty {@link Map} in which to hold branch nodes
38+
* @param leavesFactory a pure method that create a new, empty {@link Collection} in which to hold leaf values
39+
*
40+
* @param <V> the type of values stored in the created trie
41+
*
42+
* @see #createHashed()
43+
*/
1744
public static <V> CompositeStringMultiTrie<V> of(
1845
Supplier<Map<Character, Branch<V>>> branchesFactory,
1946
Supplier<Collection<V>> leavesFactory

0 commit comments

Comments
 (0)