Class SetWithLock<T>

java.lang.Object
org.aoju.bus.core.lock.ObjectWithLock<Set<T>>
org.aoju.bus.core.lock.SetWithLock<T>
Type Parameters:
T - 所涉及对象的类型
All Implemented Interfaces:
Serializable

public class SetWithLock<T> extends ObjectWithLock<Set<T>>
Set对象读写锁
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Constructor Details

    • SetWithLock

      public SetWithLock(Set<T> set)
      构造对象
      Parameters:
      set - 对象
    • SetWithLock

      public SetWithLock(Set<T> set, ReentrantReadWriteLock lock)
      Parameters:
      set - 对象
      lock - 读写锁
  • Method Details

    • add

      public boolean add(T t)
      构造对象
      Parameters:
      t - 对象
      Returns:
      the true/false
    • clear

      public void clear()
      清空对象
    • remove

      public boolean remove(T t)
      删除对象
      Parameters:
      t - 对象
      Returns:
      the true/false
    • size

      public int size()
      对象大小
      Returns:
      the int