Smack

org.jivesoftware.smack.filter
Class OrFilter

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

public class OrFilter
extends Object
implements PacketFilter

Implements the logical OR operation over two or more packet filters. In other words, packets pass this filter if they pass any of the filters.

Author:
Matt Tucker

Constructor Summary
OrFilter()
          Creates an empty OR filter.
OrFilter(PacketFilter filter1, PacketFilter filter2)
          Creates an OR filter using the two specified filters.
 
Method Summary
 boolean accept(Packet packet)
          Tests whether or not the specified packet should pass the filter.
 void addFilter(PacketFilter filter)
          Adds a filter to the filter list for the OR operation.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrFilter

public OrFilter()
Creates an empty OR filter. Filters should be added using the addFilter(PacketFilter) method.


OrFilter

public OrFilter(PacketFilter filter1,
                PacketFilter filter2)
Creates an OR filter using the two specified filters.

Parameters:
filter1 - the first packet filter.
filter2 - the second packet filter.
Method Detail

addFilter

public void addFilter(PacketFilter filter)
Adds a filter to the filter list for the OR operation. A packet will pass the filter if any filter in the list accepts it.

Parameters:
filter - a filter to add to the filter list.

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.