Class CopyOnUpdateIdentityList<T>


  • public class CopyOnUpdateIdentityList<T>
    extends java.lang.Object
    Wrapper for keeping a list which can be updated from the same thread while being iterated. The list can contain only one of each item (based on identity). Not backed by a set as that would be overkill for the use cases this class is intended for. Not thread-safe.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<T> items  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T item)  
      void remove​(T item)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • items

        public java.util.List<T> items
    • Constructor Detail

      • CopyOnUpdateIdentityList

        public CopyOnUpdateIdentityList()
    • Method Detail

      • add

        public void add​(T item)
      • remove

        public void remove​(T item)