Thatís the thing about people who think they hate computers. What they really hate is lousy programmers. Larry Niven
An EnumSet is a Set which contains enum instance of a specific enum type, in a more efficient way than other Set implementations.
|Enumset internally uses bit vector which improve the performance.|
|It improves the time and space performance.|
|It does not throw concurrent modification exception.|
|Enumset is not synchronized.|
|All basic operations execute in constant time.||All basic operations execute in constant time.|
|Faster than Hashmap.||Faster than hash set.|
|Enum maps are represented internally as arrays.||Represented internally as bit vectors.|
|Bulk operation executes in constant time.||Bulk operation executes in constant time.|
When you don't want duplicate elements, you can use EnumSet.