Class SynchronizedLinkedSet<E>

java.lang.Object
com.pnfsoftware.jeb.util.collect.SynchronizedLinkedSet<E>
Type Parameters:
E - element type

@Ser public class SynchronizedLinkedSet<E> extends Object
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 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

      public boolean contains(E e)
      Parameters:
      e - element
      Returns:
      true if the element is present
    • add

      public boolean add(E e)
      Add an element.
      Parameters:
      e - non-null element
      Returns:
      true if the set changed
    • remove

      public boolean remove(E e)
      Remove an element.
      Parameters:
      e - element
      Returns:
      true if the set changed
    • copyOfEntries

      public Set<E> copyOfEntries()
      Copy the current entries.
      Returns:
      copy of the entries
    • firstEntry

      public E firstEntry()
      Returns:
      first entry in insertion order
      Throws:
      NoSuchElementException - if the map is empty
    • toString

      public String toString()
      Overrides:
      toString in class Object