corny.addressbook.ContactUtils
Class ContactUtils

java.lang.Object
  extended by corny.addressbook.ContactUtils.ContactUtils

public class ContactUtils
extends java.lang.Object

Utility class to perform Actions on Contacts.

Author:
Corny

Constructor Summary
ContactUtils()
           
 
Method Summary
static java.util.List<Contact> filterContacts(java.util.Collection<Contact> coll, Filter filter)
          Filters the given Collection of Contacts.
static int searchAndReplace(java.util.Collection<Contact> contacts, ContactProperty property, java.lang.String propertyLabel, ValueModifier modifier)
          Searches through the Address Book and modifies the specified property.
static int searchAndReplace(java.util.Collection<Contact> contacts, ContactProperty property, java.lang.String propertyLabel, ValueModifier modifier, java.awt.Window parent)
          Searches through the Address Book and modifies the specified property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactUtils

public ContactUtils()
Method Detail

searchAndReplace

public static int searchAndReplace(java.util.Collection<Contact> contacts,
                                   ContactProperty property,
                                   java.lang.String propertyLabel,
                                   ValueModifier modifier)
Searches through the Address Book and modifies the specified property.

Parameters:
contacts - Contacts to process
property - Property to modify
propertyLabel - Label of the (multivalue) property or null to process every label
modifier - ValueModifier
Returns:
Count of Contacts modified

searchAndReplace

public static int searchAndReplace(java.util.Collection<Contact> contacts,
                                   ContactProperty property,
                                   java.lang.String propertyLabel,
                                   ValueModifier modifier,
                                   java.awt.Window parent)
Searches through the Address Book and modifies the specified property. Displays a progress dialog.

Parameters:
contacts - Contacts to process
property - Property to modify
propertyLabel - Label of the (multivalue) property or null to process every label
modifier - ValueModifier
parent - Parent window of the progress dialog
Returns:
Count of Contacts modified

filterContacts

public static java.util.List<Contact> filterContacts(java.util.Collection<Contact> coll,
                                                     Filter filter)
Filters the given Collection of Contacts. Returns a List of all Contacts which match the Filter.

Parameters:
coll - Collection to filter
filter - Filter
Returns:
List of matching Contacts