microsoft.exchange.webservices.data
Class ServiceResponseCollection<TResponse extends ServiceResponse>

java.lang.Object
  extended by microsoft.exchange.webservices.data.ServiceResponseCollection<TResponse>
Type Parameters:
TResponse - The type of response stored in the list.
All Implemented Interfaces:
java.lang.Iterable<TResponse>

public final class ServiceResponseCollection<TResponse extends ServiceResponse>
extends java.lang.Object
implements java.lang.Iterable<TResponse>

Represents a strongly typed list of service responses.


Constructor Summary
protected ServiceResponseCollection()
          * Initializes a new instance.
 
Method Summary
protected  void add(TResponse response)
          Adds specified response.
 int getCount()
          Gets the total number of responses in the list.
 java.util.Enumeration<TResponse> getEnumerator()
          Gets the enumerator.
 ServiceResult getOverallResult()
          * Gets a value indicating the overall result of the request that generated this response collection.
 TResponse getResponseAtIndex(int index)
          * Gets the response at the specified index.
 java.util.Iterator<TResponse> iterator()
          Returns an iterator over a set of elements of type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceResponseCollection

protected ServiceResponseCollection()
* Initializes a new instance.

Method Detail

add

protected void add(TResponse response)
Adds specified response.

Parameters:
response - The response.

getCount

public int getCount()
Gets the total number of responses in the list.

Returns:
total number of responses in the list.

getResponseAtIndex

public TResponse getResponseAtIndex(int index)
                                                     throws java.lang.IndexOutOfBoundsException
* Gets the response at the specified index.

Parameters:
index - The zero-based index of the response to get.
Returns:
The response at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - the index out of bounds exception

getOverallResult

public ServiceResult getOverallResult()
* Gets a value indicating the overall result of the request that generated this response collection. If all of the responses have their Result property set to Success, OverallResult returns Success. If at least one response has its Result property set to Warning and all other responses have their Result property set to Success, OverallResult returns Warning. If at least one response has a its Result set to Error, OverallResult returns Error.

Returns:
the overall result

iterator

public java.util.Iterator<TResponse> iterator()
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface java.lang.Iterable<TResponse extends ServiceResponse>
Returns:
an Iterator.

getEnumerator

public java.util.Enumeration<TResponse> getEnumerator()
Gets the enumerator.

Returns:
the enumerator