org.glassfish.pfl.tf.timer.impl
Class VersionedHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
org.glassfish.pfl.tf.timer.impl.VersionedHashSet<E>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>
public class VersionedHashSet<E>
- extends HashSet<E>
This is an implementation of the Set interface that keeps track
of its version so that we can tell when it is modified.
Each time an element is added to or removed from the set, the
version is incremented.
This implementation is synchronized so that the version
is consistently updated whenever the set is modified.
- See Also:
- Serialized Form
VersionedHashSet
public VersionedHashSet()
VersionedHashSet
public VersionedHashSet(Collection<? extends E> c)
VersionedHashSet
public VersionedHashSet(int initialCapacity,
float loadFactor)
VersionedHashSet
public VersionedHashSet(int initialCapacity)
version
public long version()
add
public boolean add(E e)
- Specified by:
add in interface Collection<E>- Specified by:
add in interface Set<E>- Overrides:
add in class HashSet<E>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface Set<E>- Overrides:
remove in class HashSet<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in interface Set<E>- Overrides:
iterator in class HashSet<E>
Copyright © 2013 Oracle. All Rights Reserved.