类 Sets

java.lang.Object
com.weicoder.common.lang.Sets
直接已知子类:
W.S

public sealed class Sets extends Object permits W.S
Set的帮助类,获得Set的一些操作
作者:
WD
  • 构造器详细资料

    • Sets

      public Sets()
  • 方法详细资料

    • is

      public static boolean is(Object obj)
      判断是否Set
      参数:
      obj - 对象
      返回:
      是否Set
    • set

      public static <E> HashSet<E> set()
      获得Set实例 实现类是HashSet 默认初始化大小为10
      类型参数:
      E - 泛型
      返回:
      Set
    • set

      public static <E> HashSet<E> set(int size)
      获得Set实例 实现类是HashSet
      类型参数:
      E - 泛型
      参数:
      size - 初始化大小
      返回:
      Set
    • set

      public static <E> Set<E> set(E[] es)
      获得Set实例 实现类是HashSet
      类型参数:
      E -
      参数:
      es - 初始化数组
      返回:
      Set
    • set

      public static <E> Set<E> set(Collection<E> c)
      获得Set实例 实现类是HashSet
      类型参数:
      E - 泛型
      参数:
      c - 初始化的集合
      返回:
      Set
    • tree

      public static <E> TreeSet<E> tree()
      获得TreeSet实例
      类型参数:
      E - 泛型
      返回:
      TreeSet
    • hash

      public static <E> HashSet<E> hash()
      获得HashSet实例
      类型参数:
      E - 泛型
      参数:
      size - 容量
      返回:
      HashSet
    • hash

      public static <E> HashSet<E> hash(int size)
      获得HashSet实例
      类型参数:
      E - 泛型
      参数:
      size - 容量
      返回:
      HashSet
    • hash

      public static <E> HashSet<E> hash(Collection<E> c)
      获得HashSet实例
      类型参数:
      E - 泛型
      参数:
      c - 集合
      返回:
      HashSet
    • empty

      public static <E> Set<E> empty()
      获得一个不可变的空Set
      类型参数:
      E - 泛型
      返回:
      一个不可变的空Set
    • size

      public static int size(Set<?> set)
      获得列表数量
      参数:
      set - 数据列表
      返回:
      数量