Skip to content
Snippets Groups Projects
Commit 73d0c17c authored by Adam Blank's avatar Adam Blank
Browse files

Updates A to be Comparable everywhere

parent 8e2eb323
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,7 @@ import java.util.Iterator;
import cse332.interfaces.worklists.FixedSizeFIFOWorkList;
import datastructures.worklists.CircularArrayFIFOQueue;
public abstract class BString<Alphabet>
implements Iterable<Alphabet>, Comparable<BString<Alphabet>> {
public abstract class BString<Alphabet extends Comparable<Alphabet> implements Iterable<Alphabet>, Comparable<BString<Alphabet>> {
protected FixedSizeFIFOWorkList<Alphabet> str;
public BString(Alphabet[] str) {
......
......@@ -30,7 +30,7 @@ import datastructures.worklists.ListFIFOQueue;
*
* @author Adam Blank
*/
public abstract class TrieMap<A, K extends BString<A>, V> extends Dictionary<K, V> {
public abstract class TrieMap<A extends Comparable<A>, K extends BString<A>, V> extends Dictionary<K, V> {
protected TrieNode<?, ?> root;
/**
......
......@@ -3,7 +3,7 @@ package cse332.interfaces.trie;
import cse332.interfaces.misc.BString;
import cse332.interfaces.misc.Set;
public abstract class TrieSet<A, E extends BString<A>> extends Set<E> {
public abstract class TrieSet<A extends Comparable<A>, E extends BString<A>> extends Set<E> {
protected TrieSet(TrieMap<A, E, Boolean> backingMap) {
super(backingMap);
}
......
......@@ -12,8 +12,7 @@ import datastructures.dictionaries.HashTrieMap;
import p2.wordsuggestor.WordSuggestor;
public class NGramTester {
public static <A, K extends BString<A>, V> Supplier<Dictionary<K, V>> trieConstructor(
Class<K> clz) {
public static <A extends Comparable<A>, K extends BString<A>, V> Supplier<Dictionary<K, V>> trieConstructor(Class<K> clz) {
return () -> new HashTrieMap<A, K, V>(clz);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment