Class ConcurrentWrapper<W>

java.lang.Object
ru.progrm_jarvis.javacommons.collection.concurrent.ConcurrentWrapper<W>
Type Parameters:
W - type of wrapped value
Direct Known Subclasses:
AbstractConcurrentSizedCollectionWrapper

public class ConcurrentWrapper<W> extends Object
Base for all concurrent wrappers.
  • Field Details

    • wrapped

      @NotNull protected final W wrapped
    • readLock

      @NotNull protected final @NotNull Lock readLock
    • writeLock

      @NotNull protected final @NotNull Lock writeLock
  • Constructor Details

    • ConcurrentWrapper

      protected ConcurrentWrapper(@NotNull W wrapped, @NotNull @NotNull Lock readLock, @NotNull @NotNull Lock writeLock)
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Implementation note
      this method is not concurrent because if modification happens then the result of its call is anyway irrelevant, simply calls to wrapped's Object.hashCode() method as it provides a logically unique value
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Implementation note
      this method is not concurrent because if modification happens then the result of its call is anyway irrelevant, simply calls to wrapped's Object.equals(Object) method as it provides mostly symmetric logic
    • toString

      public String toString()
      Overrides:
      toString in class Object