/** * Wrapper for different types of words * * @author Alexander Schaap * * @param * type of the word */ public class Word> implements WordInterface { T word; // cannot be primitive type; // https://stackoverflow.com/questions/2721546/why-dont-java-generics-support-primitive-types public Word(T word) { this.word = word; } @Override public int compareTo(WordInterface w) { return word.compareTo(w.word()); } @Override public T word() { return word; } @Override public String toString() { return word.toString(); } }