microsoft.exchange.webservices.data
Class SearchFilter.SearchFilterCollection

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.SearchFilter
          extended by microsoft.exchange.webservices.data.SearchFilter.SearchFilterCollection
All Implemented Interfaces:
java.lang.Iterable<SearchFilter>
Enclosing class:
SearchFilter

public static class SearchFilter.SearchFilterCollection
extends SearchFilter
implements java.lang.Iterable<SearchFilter>

Represents a collection of search filters linked by a logical operator. Applications can use SearchFilterCollection to define complex search filters such as "Condition1 AND Condition2".


Nested Class Summary
 
Nested classes/interfaces inherited from class microsoft.exchange.webservices.data.SearchFilter
SearchFilter.ContainsSubstring, SearchFilter.ExcludesBitmask, SearchFilter.Exists, SearchFilter.IsEqualTo, SearchFilter.IsGreaterThan, SearchFilter.IsGreaterThanOrEqualTo, SearchFilter.IsLessThan, SearchFilter.IsLessThanOrEqualTo, SearchFilter.IsNotEqualTo, SearchFilter.Not, SearchFilter.PropertyBasedFilter, SearchFilter.RelationalFilter, SearchFilter.SearchFilterCollection
 
Constructor Summary
SearchFilter.SearchFilterCollection()
          Initializes a new instance of the class.
SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator)
          Initializes a new instance of the class.
SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator, java.lang.Iterable<SearchFilter> searchFilters)
          Initializes a new instance of the class.
SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator, SearchFilter... searchFilters)
          Initializes a new instance of the class.
 
Method Summary
 void add(SearchFilter searchFilter)
          Adds a search filter of any type to the collection.
 void addRange(java.lang.Iterable<SearchFilter> searchFilters)
          Adds multiple search filters to the collection.
 void clear()
          Clears the collection.
 void complexPropertyChanged(ComplexProperty complexProperty)
          Complex property changed.
 boolean contains(SearchFilter searchFilter)
          Determines whether a specific search filter is in the collection.
 int getCount()
          Gets the total number of search filters in the collection.
 LogicalOperator getLogicalOperator()
          Gets the logical operator that links the serach filters in this collection.
 SearchFilter getSearchFilter(int index)
          Gets the search filter at the specified index.
protected  java.lang.String getXmlElementName()
          Gets the name of the XML element.
protected  void internalValidate()
          Validate instance.
 java.util.Iterator<SearchFilter> iterator()
           
 void remove(SearchFilter searchFilter)
          Removes a search filter from the collection.
 void removeAt(int index)
          Removes the search filter at the specified index from the collection.
 void setLogicalOperator(LogicalOperator logicalOperator)
          Sets the logical operator that links the serach filters in this collection.
 void setSearchFilter(int index, SearchFilter searchFilter)
          Sets the search filter at the specified index.
protected  boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          Tries to read element from XML.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Writes the elements to XML.
protected  void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Writes to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.SearchFilter
loadFromXml
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchFilter.SearchFilterCollection

public SearchFilter.SearchFilterCollection()
Initializes a new instance of the class.


SearchFilter.SearchFilterCollection

public SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator)
Initializes a new instance of the class.

Parameters:
logicalOperator - The logical operator used to initialize the collection.

SearchFilter.SearchFilterCollection

public SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator,
                                           SearchFilter... searchFilters)
Initializes a new instance of the class.

Parameters:
logicalOperator - The logical operator used to initialize the collection.
searchFilters - The search filters to add to the collection.

SearchFilter.SearchFilterCollection

public SearchFilter.SearchFilterCollection(LogicalOperator logicalOperator,
                                           java.lang.Iterable<SearchFilter> searchFilters)
Initializes a new instance of the class.

Parameters:
logicalOperator - The logical operator used to initialize the collection.
searchFilters - The search filters to add to the collection.
Method Detail

internalValidate

protected void internalValidate()
                         throws java.lang.Exception
Validate instance.

Overrides:
internalValidate in class ComplexProperty
Throws:
java.lang.Exception

getXmlElementName

protected java.lang.String getXmlElementName()
Gets the name of the XML element.

Specified by:
getXmlElementName in class SearchFilter
Returns:
xml element name

tryReadElementFromXml

protected boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                                 throws java.lang.Exception
Tries to read element from XML.

Overrides:
tryReadElementFromXml in class ComplexProperty
Parameters:
reader - the reader
Returns:
true, if successful
Throws:
java.lang.Exception - the exception

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws java.lang.Exception
Writes the elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - the writer
Throws:
java.lang.Exception - the exception

writeToXml

protected void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                   throws java.lang.Exception
Writes to XML.

Overrides:
writeToXml in class SearchFilter
Parameters:
writer - the writer
Throws:
java.lang.Exception - the exception

add

public void add(SearchFilter searchFilter)
Adds a search filter of any type to the collection.

Parameters:
searchFilter - >The search filter to add. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection.

addRange

public void addRange(java.lang.Iterable<SearchFilter> searchFilters)
Adds multiple search filters to the collection.

Parameters:
searchFilters - The search filters to add. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection

clear

public void clear()
Clears the collection.


contains

public boolean contains(SearchFilter searchFilter)
Determines whether a specific search filter is in the collection.

Parameters:
searchFilter - The search filter to locate in the collection.
Returns:
True is the search filter was found in the collection, false otherwise.

remove

public void remove(SearchFilter searchFilter)
Removes a search filter from the collection.

Parameters:
searchFilter - The search filter to remove

removeAt

public void removeAt(int index)
Removes the search filter at the specified index from the collection.

Parameters:
index - The zero-based index of the search filter to remove.

getCount

public int getCount()
Gets the total number of search filters in the collection.

Returns:
the count

getSearchFilter

public SearchFilter getSearchFilter(int index)
Gets the search filter at the specified index.

Parameters:
index - the index
Returns:
The search filter at the specified index.

setSearchFilter

public void setSearchFilter(int index,
                            SearchFilter searchFilter)
Sets the search filter at the specified index.

Parameters:
index - the index
searchFilter - the search filter

getLogicalOperator

public LogicalOperator getLogicalOperator()
Gets the logical operator that links the serach filters in this collection.

Returns:
LogicalOperator

setLogicalOperator

public void setLogicalOperator(LogicalOperator logicalOperator)
Sets the logical operator that links the serach filters in this collection.

Parameters:
logicalOperator - the new logical operator

complexPropertyChanged

public void complexPropertyChanged(ComplexProperty complexProperty)
Complex property changed.

Parameters:
complexProperty - the complex property

iterator

public java.util.Iterator<SearchFilter> iterator()
Specified by:
iterator in interface java.lang.Iterable<SearchFilter>