I'm developing a Handle
for a stream of data, where events will be periodically released that should be captured by a small set of Listeners
from 1 to 5 listeners
.
This set of listeners
does not need to be triggered in a registration sequence, it will only be guaranteed that if some excpetion
is released, it will be made available in log
, without interrupting the others.
What is the best implementation of Interface java.util.Set
considering:
- No need to sort
- The set will be constant (it will not be immutable, but it will not have been constantly changed during execution)
- It will not be necessary for recurring calls to be obtained in the same order.
- You will not need to be Thread Safe.
- The set will be small, initially from 1 to 5% with%.