microsoft.exchange.webservices.data
Class EmailAddressCollection

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.ComplexPropertyCollection<EmailAddress>
          extended by microsoft.exchange.webservices.data.EmailAddressCollection
All Implemented Interfaces:
java.lang.Iterable<EmailAddress>

public final class EmailAddressCollection
extends ComplexPropertyCollection<EmailAddress>

Represents a collection of e-mail addresses.


Constructor Summary
protected EmailAddressCollection()
          * Initializes a new instance.
protected EmailAddressCollection(java.lang.String collectionItemXmlElementName)
          Initializes a new instance of the EmailAddressCollection class.
 
Method Summary
 void add(EmailAddress emailAddress)
          Adds an e-mail address to the collection.
 EmailAddress add(java.lang.String smtpAddress)
          Adds an e-mail address to the collection.
 EmailAddress add(java.lang.String name, java.lang.String smtpAddress)
          Adds an e-mail address to the collection.
 void addEmailRange(java.util.Iterator<EmailAddress> emailAddresses)
          Adds multiple e-mail addresses to the collection.
 void addSmtpAddressRange(java.util.Iterator<java.lang.String> smtpAddresses)
          Adds multiple e-mail addresses to the collection.
 void clear()
          Clears the collection.
protected  EmailAddress createComplexProperty(java.lang.String xmlElementName)
          Creates an EmailAddress object from an XML element name.
protected  java.lang.String getCollectionItemXmlElementName(EmailAddress complexProperty)
          Retrieves the XML element name corresponding to the provided EmailAddress object.
 boolean remove(EmailAddress emailAddress)
          * Removes an e-mail address from the collection.
 void removeAt(int index)
          Removes an e-mail address from the collection.
protected  boolean shouldWriteToXml()
          Determine whether we should write collection to XML or not.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexPropertyCollection
clearChangeLog, complexPropertyChanged, contains, getAddedItems, getCount, getItems, getModifiedItems, getPropertyAtIndex, getRemovedItems, indexOf, internalAdd, internalClear, internalRemove, internalRemoveAt, itemChanged, iterator, loadFromXml, loadFromXml, removeFromChangeLog, updateFromXml, writeDeleteUpdateToXml, writeElementsToXml, writeSetUpdateToXml, writeToXml
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, func, getNamespace, internalValidate, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, validate, writeAttributesToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailAddressCollection

protected EmailAddressCollection()
* Initializes a new instance.


EmailAddressCollection

protected EmailAddressCollection(java.lang.String collectionItemXmlElementName)
Initializes a new instance of the EmailAddressCollection class.

Parameters:
collectionItemXmlElementName - Name of the collection item XML element.
Method Detail

add

public void add(EmailAddress emailAddress)
Adds an e-mail address to the collection.

Parameters:
emailAddress - The e-mail address to add.

addEmailRange

public void addEmailRange(java.util.Iterator<EmailAddress> emailAddresses)
Adds multiple e-mail addresses to the collection.

Parameters:
emailAddresses - The e-mail addresses to add.

add

public EmailAddress add(java.lang.String smtpAddress)
Adds an e-mail address to the collection.

Parameters:
smtpAddress - The SMTP address used to initialize the e-mail address.
Returns:
An EmailAddress object initialized with the provided SMTP address.

addSmtpAddressRange

public void addSmtpAddressRange(java.util.Iterator<java.lang.String> smtpAddresses)
Adds multiple e-mail addresses to the collection.

Parameters:
smtpAddresses - The SMTP addresses used to initialize the e-mail addresses.

add

public EmailAddress add(java.lang.String name,
                        java.lang.String smtpAddress)
Adds an e-mail address to the collection.

Parameters:
name - The name used to initialize the e-mail address.
smtpAddress - The SMTP address used to initialize the e-mail address.
Returns:
An EmailAddress object initialized with the provided SMTP address.

clear

public void clear()
Clears the collection.


removeAt

public void removeAt(int index)
Removes an e-mail address from the collection.

Parameters:
index - The index of the e-mail address to remove.

remove

public boolean remove(EmailAddress emailAddress)
               throws java.lang.Exception
* Removes an e-mail address from the collection.

Parameters:
emailAddress - The e-mail address to remove.
Returns:
True if the email address was successfully removed from the collection, false otherwise.
Throws:
java.lang.Exception - the exception

createComplexProperty

protected EmailAddress createComplexProperty(java.lang.String xmlElementName)
Creates an EmailAddress object from an XML element name.

Specified by:
createComplexProperty in class ComplexPropertyCollection<EmailAddress>
Parameters:
xmlElementName - The XML element name from which to create the e-mail address.
Returns:
An EmailAddress object.

getCollectionItemXmlElementName

protected java.lang.String getCollectionItemXmlElementName(EmailAddress complexProperty)
Retrieves the XML element name corresponding to the provided EmailAddress object.

Specified by:
getCollectionItemXmlElementName in class ComplexPropertyCollection<EmailAddress>
Parameters:
complexProperty - The EmailAddress object from which to determine the XML element name.
Returns:
The XML element name corresponding to the provided EmailAddress object.

shouldWriteToXml

protected boolean shouldWriteToXml()
Determine whether we should write collection to XML or not.

Overrides:
shouldWriteToXml in class ComplexPropertyCollection<EmailAddress>
Returns:
Always true, even if the collection is empty.