Smack

org.jivesoftware.smack.filter
Class AndFilter

java.lang.Object
  extended byorg.jivesoftware.smack.filter.AndFilter
All Implemented Interfaces:
PacketFilter

public class AndFilter
extends Object
implements PacketFilter

Implements the logical AND operation over two packet filters. In other words, packets pass this filter if they pass both of the filters.

Author:
Matt Tucker

Constructor Summary
AndFilter(PacketFilter filter1, PacketFilter filter2)
          Creates an AND filter using the specified filters.
 
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

AndFilter

public AndFilter(PacketFilter filter1,
                 PacketFilter filter2)
Creates an AND filter using the specified filters.

Parameters:
filter1 - the first packet filter.
filter2 - the second packet filter.
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 Jive Software.