- java.lang.Object
-
- ch.bind.philib.util.CowSet<E>
-
public final class CowSet<E> extends Object
A simple implementation of a copy-on-write set.
There are two modification methods:add(Object)andremove(Object)
and two read methods:getView()andisEmpty()
Every modification through theadd(Object)orremove(Object)methods and a return value oftruewill update the view.
The view is shared among all clients and must therefore not be modified!
The modification methods are not optimized for speed since the intent of this cow-list is to guarantee fast reads.- Author:
- Philipp Meinen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)E[]getView()booleanisEmpty()booleanremove(E e)intsize()
-