Class PacketTypeSet

java.lang.Object
com.comphenix.protocol.concurrency.PacketTypeSet

public class PacketTypeSet extends Object
Represents a concurrent set of packet types.
  • Constructor Details

    • PacketTypeSet

      public PacketTypeSet()
    • PacketTypeSet

      public PacketTypeSet(Collection<? extends PacketType> values)
  • Method Details

    • addType

      public void addType(PacketType type)
      Add a particular type to the set.
      Parameters:
      type - - the type to add.
    • addAll

      public void addAll(Iterable<? extends PacketType> types)
      Add the given types to the set of packet types.
      Parameters:
      types - - the types to add.
    • removeType

      public void removeType(PacketType type)
      Remove a particular type to the set.
      Parameters:
      type - - the type to remove.
    • removeAll

      public void removeAll(Iterable<? extends PacketType> types)
      Remove the given types from the set.
      Parameters:
      types - Types to remove
    • contains

      public boolean contains(PacketType type)
      Determine if the given packet type exists in the set.
      Parameters:
      type - - the type to find.
      Returns:
      TRUE if it does, FALSE otherwise.
    • contains

      public boolean contains(Class<?> packetClass)
      Determine if a packet type with the given packet class exists in the set.
      Parameters:
      packetClass - - the class to find.
      Returns:
      TRUE if it does, FALSE otherwise.
    • containsPacket

      public boolean containsPacket(Object packet)
      Determine if the type of a packet is in the current set.
      Parameters:
      packet - - the packet.
      Returns:
      TRUE if it is, FALSE otherwise.
    • values

      public Set<PacketType> values()
      Retrieve a view of this packet type set.
      Returns:
      The packet type values.
    • size

      public int size()
      Retrieve the number of entries in the set.
      Returns:
      The number of entries.
    • clear

      public void clear()