Smack

org.jivesoftware.smack.filter
Class ToContainsFilter

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

public class ToContainsFilter
extends Object
implements PacketFilter

Filters for packets where the "to" field contains a specified value. For example, the filter could be used to listen for all packets sent to a group chat nickname.

Author:
Matt Tucker

Constructor Summary
ToContainsFilter(String to)
          Creates a "to" contains filter using the "to" field part.
 
Method Summary
 boolean accept(Packet packet)
          Tests whether or not the specified packet should pass the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToContainsFilter

public ToContainsFilter(String to)
Creates a "to" contains filter using the "to" field part.

Parameters:
to - the to field value the packet must contain.
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.

Smack

Copyright © 2003-2007 Jive Software.