类 Sets

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

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

    • Sets

      public Sets()
  • 方法详细资料

    • isSet

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

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

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

      @SafeVarargs public static <E> HashSet<E> newSet(E... es)
      获得Set实例 实现类是HashSet
      类型参数:
      E - 泛型
      参数:
      es - 初始化的集合
      返回:
      Set
    • newSet

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

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

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