Class SynchronizedCollection<E>

    • Field Detail

      • lock

        protected final Object lock
        The object to lock on, needed for List/SortedSet views
    • Constructor Detail

      • SynchronizedCollection

        protected SynchronizedCollection​(Collection<E> collection)
        Constructor that wraps (not copies).
        Parameters:
        collection - the collection to decorate, must not be null
        Throws:
        NullPointerException - if the collection is null
      • SynchronizedCollection

        protected SynchronizedCollection​(Collection<E> collection,
                                         Object lock)
        Constructor that wraps (not copies).
        Parameters:
        collection - the collection to decorate, must not be null
        lock - the lock object to use, must not be null
        Throws:
        NullPointerException - if the collection or lock is null