Class Sets

java.lang.Object
pcap.common.util.Sets

@Inclubating
public final class Sets
extends Object
Author:
Ardika Rommy Sanjaya
  • Constructor Details

    • Sets

      public Sets()
  • Method Details

    • createHashSet

      public static <E> Set<E> createHashSet​(int expectedMapSize)
      Create an HashSet with its initialCapacity calculated to minimize rehash operations
      Type Parameters:
      E - type.
      Parameters:
      expectedMapSize - expected map size
      Returns:
      returns Set object.
    • createLinkedHashSet

      public static <E> Set<E> createLinkedHashSet​(int expectedMapSize)
      Create an LinkedHashSet with its initialCapacity calculated to minimize rehash operations
      Type Parameters:
      E - type.
      Parameters:
      expectedMapSize - expected map size
      Returns:
      returns Set object.