Class SynchronizedCollection

    • Field Detail

      • collection

        protected final Collection collection
        The collection to decorate
      • lock

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

      • SynchronizedCollection

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

        protected SynchronizedCollection​(Collection 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:
        IllegalArgumentException - if the collection is null