Class PacketTypeSet
java.lang.Object
com.comphenix.protocol.concurrency.PacketTypeSet
Represents a concurrent set of packet types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(Iterable<? extends PacketType> types) Add the given types to the set of packet types.voidaddType(PacketType type) Add a particular type to the set.voidclear()booleancontains(PacketType type) Determine if the given packet type exists in the set.booleanDetermine if a packet type with the given packet class exists in the set.booleancontainsPacket(Object packet) Determine if the type of a packet is in the current set.voidremoveAll(Iterable<? extends PacketType> types) Remove the given types from the set.voidremoveType(PacketType type) Remove a particular type to the set.intsize()Retrieve the number of entries in the set.values()Retrieve a view of this packet type set.
-
Constructor Details
-
PacketTypeSet
public PacketTypeSet() -
PacketTypeSet
-
-
Method Details
-
addType
Add a particular type to the set.- Parameters:
type- - the type to add.
-
addAll
Add the given types to the set of packet types.- Parameters:
types- - the types to add.
-
removeType
Remove a particular type to the set.- Parameters:
type- - the type to remove.
-
removeAll
Remove the given types from the set.- Parameters:
types- Types to remove
-
contains
Determine if the given packet type exists in the set.- Parameters:
type- - the type to find.- Returns:
- TRUE if it does, FALSE otherwise.
-
contains
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
Determine if the type of a packet is in the current set.- Parameters:
packet- - the packet.- Returns:
- TRUE if it is, FALSE otherwise.
-
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()
-