EnumSet
draws its efficiency from the key constraint that it contains strictly members of a single enum. It achieves this by efficiently storing its state with reliance on ordinal
number of each enum member, basically behaving like a BitSet
. So unfortunately you won't be able to reap its benefits if you want multiple enums.
The closest you can get to this goal is by devising your own numbering scheme which is distinct across all your enums, and using a BitSet
to efficiently store them.