Smack

org.jivesoftware.smack.filter
Class PacketTypeFilter

java.lang.Object
  extended by org.jivesoftware.smack.filter.PacketTypeFilter
All Implemented Interfaces:
PacketFilter

public class PacketTypeFilter
extends Object
implements PacketFilter

Filters for packets of a particular type. The type is given as a Class object, so example types would:

Author:
Matt Tucker

Constructor Summary
PacketTypeFilter(Class packetType)
          Creates a new packet type filter that will filter for packets that are the same type as packetType.
 
Method Summary
 boolean accept(Packet packet)
          Tests whether or not the specified packet should pass the filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PacketTypeFilter

public PacketTypeFilter(Class packetType)
Creates a new packet type filter that will filter for packets that are the same type as packetType.

Parameters:
packetType - the Class type.
Method Detail

accept

public boolean accept(Packet packet)
Description copied from interface: PacketFilter
Tests whether or not the specified packet should pass the filter.

Specified by:
accept in interface PacketFilter
Parameters:
packet - the packet to test.
Returns:
true if and only if packet passes the filter.

toString

public String toString()
Overrides:
toString in class Object

Smack

Copyright © 2003-2007 Jive Software.