Klasse Iterators.Synchronized<E>

java.lang.Object
org.jupnp.util.Iterators.Synchronized<E>
Alle implementierten Schnittstellen:
Iterator<E>
Umschließende Klasse:
Iterators

public abstract static class Iterators.Synchronized<E> extends Object implements Iterator<E>
Wraps a collection and provides stable iteration with thread-safe removal.

Internally uses the iterator of a CopyOnWriteArrayList, when remove() is called, delegates to synchronizedRemove(int).

  • Konstruktordetails

    • Synchronized

      protected Synchronized(Collection<E> collection)
  • Methodendetails

    • hasNext

      public boolean hasNext()
      Angegeben von:
      hasNext in Schnittstelle Iterator<E>
    • next

      public E next()
      Angegeben von:
      next in Schnittstelle Iterator<E>
    • remove

      public void remove()
      Angegeben von:
      remove in Schnittstelle Iterator<E>
    • synchronizedRemove

      protected abstract void synchronizedRemove(int index)
      Must remove the element at the given index from the original collection in a thread-safe fashion.