I have recently been programming an Entity Component System in Java for a small game that I am working on. From what I have tested, it works rather well however I question the component part. I currently have an Entity class that stores subclasses of Component in a HashMap which can be accessed by a String:
private Map<String, Component> components = new HashMap<String, Component>();
The problem is that my root Component class looks like this:
public class Component {
}
I feel as if I've headed in the wrong direction so my question is do I need a Component super class? If so, is there anything that needs to be put in it? If not, should I have a HashMap of Objects instead? Are there advantages to either methods?