net.wimpi.pim.contact.db
Class AbstractContactFilter

java.lang.Object
  |
  +--net.wimpi.pim.contact.db.AbstractContactFilter
All Implemented Interfaces:
ContactFilter

public abstract class AbstractContactFilter
extends java.lang.Object
implements ContactFilter

Class representing an abstract ContactFilter. to be extended for simplifying implementations.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger (wimpi)

Field Summary
protected  ContactFilter m_ChildFilter
           
 
Constructor Summary
AbstractContactFilter()
           
 
Method Summary
 ContactFilter getChildFilter()
          Returns the child filter of this AbstractContactFilter.
abstract  boolean passes(Contact contact)
          Tests if a given contact passes through this ContactFilter.
 boolean passesChildFilter(Contact contact)
          Tests if the given Contact instance passes this AbstractContactFilter's child filter.
 void setChildFilter(ContactFilter filter)
          Sets a child filter, which will be applied by the parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_ChildFilter

protected ContactFilter m_ChildFilter
Constructor Detail

AbstractContactFilter

public AbstractContactFilter()
Method Detail

passes

public abstract boolean passes(Contact contact)
Description copied from interface: ContactFilter
Tests if a given contact passes through this ContactFilter.

Specified by:
passes in interface ContactFilter
Parameters:
contact - a Contact instance.
Returns:
true if passes, false otherwise.

passesChildFilter

public boolean passesChildFilter(Contact contact)
Tests if the given Contact instance passes this AbstractContactFilter's child filter.

If this AbstractContactFilter has no child filter set, this method will always return true.

Parameters:
contact - a Contact instance.
Returns:
true if passes (or no child filter set), false otherwise.

setChildFilter

public void setChildFilter(ContactFilter filter)
Description copied from interface: ContactFilter
Sets a child filter, which will be applied by the parent.

Note that this semantics allow to construct chains of different filters.

Specified by:
setChildFilter in interface ContactFilter
Parameters:
filter - a ContactFilter instance.

getChildFilter

public ContactFilter getChildFilter()
Returns the child filter of this AbstractContactFilter.

Returns:
the child filter as ContactFilter.


Copyright © 2001-2003 jpim team.