Package com.pnfsoftware.jeb.util.collect
Class SynchronizedLinkedSet<E>
java.lang.Object
com.pnfsoftware.jeb.util.collect.SynchronizedLinkedSet<E>
- Type Parameters:
E- element type
A serializable, inefficient, fully synchronized, linked pseudo-set. (Refer to
SynchronizedLinkedMap for additional details.)
This class does not allow null keys.
Methods of this object are guaranteed to never raise ConcurrentModificationException.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SynchronizedLinkedSet
public SynchronizedLinkedSet()Create an empty synchronized linked set.
-
-
Method Details
-
size
public int size()- Returns:
- number of entries
-
clear
public void clear()Remove all entries. -
isEmpty
public boolean isEmpty()- Returns:
- true if no entry exists
-
contains
- Parameters:
e- element- Returns:
- true if the element is present
-
add
Add an element.- Parameters:
e- non-null element- Returns:
- true if the set changed
-
remove
Remove an element.- Parameters:
e- element- Returns:
- true if the set changed
-
copyOfEntries
Copy the current entries.- Returns:
- copy of the entries
-
firstEntry
- Returns:
- first entry in insertion order
- Throws:
NoSuchElementException- if the map is empty
-
toString
-