I'm trying to add instances to the following EnumMap:
class ActiveG<D extends GData, T extends GTemplate> {
EnumMap<GStateType, GState<ActiveG<D,T>> map;
..
..
}
class TGData extends GData {...}
class TGTemplate extends GTemplate {....}
class ActiveTG extends ActiveG<TGData, TGTemplate> {
// fails with compilation error
super.states.put(GStateType.WAITING, new TGWaitingState<ActiveTG>(this));
...
...
}
The error I get:
The method put(GStateType, GState<ActiveG<TGData,TGTemplate>>) in the
type EnumMap<GStateType,GState<ActiveG<TGData,TGTemplate>>> is not
applicable for the arguments (GStateType, TGWaitingState<ActiveTG>)
Can anyone try to help me figure out what's missing to make it work?? Thanks!
EnumMap<Long, ...>? What are you trying to do? Do you have someenum Long {}somewhere or are you trying to usejava.lang.Longas a key in anEnumMap? Actually the code example doesn't make any sense because you are callingsuper.states.putbut you've shown us the declaration forEnumMap<...> map. Please clarify and post correct code that reproduces the error. stackoverflow.com/help/mcve