Answer the question
In order to leave comments, you need to log in
Java template implementation?
Did it like this:
public class Trie<T> implements Map<String, T> {
private class TrieEntry<S> implements Map.Entry<String, S> {
// stupid implementation here
}
// uninterested code here
}
public Set<java.util.Map.Entry<String, T>> entrySet() {
Set<java.util.Map.Entry<String, T>> x = new HashSet<TrieEntry<T>>();
// some uninterested code here
}
Answer the question
In order to leave comments, you need to log in
If A extends B does not mean that Set extends Set You can just write
Set<java.util.Map.Entry<String, T>> x = new HashSet<java.util.Map.Entry<String, T>>( );
and put your implementation there.
Try this
Set<? extends java.util.Map.Entry<String, T>> x = new HashSet<TrieEntry>();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question