More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. W.A. Wulf
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.