接口 PoolableArrayHandler<T>


public interface PoolableArrayHandler<T>
类数组对象的处理器
作者:
wjybxx date - 2024/7/19
  • 方法概要

    修饰符和类型
    方法
    说明
    create(ObjectPool<? super T> pool, int capacity)
    创建对象
    void
    destroy(T obj)
    销毁对象 1.对象未能归还到池中,或对象池清理时调用。
    int
    获取实例的空间
    void
    reset(T obj)
    重置对象数据
    boolean
    validate(T obj)
    验证对象的有效性
  • 方法详细资料

    • getCapacity

      int getCapacity(T obj)
      获取实例的空间
    • create

      T create(ObjectPool<? super T> pool, int capacity)
      创建对象
      参数:
      pool - 请求创建对象的池
      capacity - 容量参数
    • reset

      void reset(T obj)
      重置对象数据
    • validate

      boolean validate(T obj)
      验证对象的有效性
    • destroy

      void destroy(T obj)
      销毁对象 1.对象未能归还到池中,或对象池清理时调用。 2.可能是一个无效状态的对象 3.这类对象通常与IO操作相关,可能有必须释放的资源