com.crystaldecisions.sdk.exception
Class SDKExceptionsCollector

java.lang.Object
  |
  +--com.crystaldecisions.sdk.exception.SDKExceptionsCollector

public class SDKExceptionsCollector
extends java.lang.Object

This class is used to collect SDKExceptions potentially thrown in a batch operation related to multiple operations.


Constructor Summary
SDKExceptionsCollector()
          Create an empty collector.
SDKExceptionsCollector(SDKExceptionsCollector other)
          Construct a collector back by other collector.
 
Method Summary
 void close()
          Closes the collector.
 void collect(SDKException e)
          Adds an exception to the collector.
 SDKException get(int index)
          Return the exception in the specified index.
 SDKException getAssembleExceptions()
          Returns the exception assembling all the exceptions in the collector if the size() > 1, or the exception itself if the size() == 1, or null if the collector is empty.
 int indexOf(SDKException e)
          Finds the index of the exception.
 SDKException remove(int index)
          Removes an exception from the collector.
 int size()
          Returns the size of the collector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDKExceptionsCollector

public SDKExceptionsCollector(SDKExceptionsCollector other)
Construct a collector back by other collector. This can be used to chain two different SDKExceptionCollectors.

Parameters:
other - The other collector that already collects some exceptions.

SDKExceptionsCollector

public SDKExceptionsCollector()
Create an empty collector.

Method Detail

get

public SDKException get(int index)
Return the exception in the specified index.

Parameters:
index - The index of the exception object to be returned.
Returns:
The exception indexed by the index parameter.

size

public int size()
Returns the size of the collector.

Returns:
The size of the collector.

collect

public void collect(SDKException e)
Adds an exception to the collector.

Parameters:
e - The exception to be collected.

remove

public SDKException remove(int index)
Removes an exception from the collector.

Parameters:
index - The index of the exception in the collector to be removed.
Returns:
The exception just removed from the collector.

indexOf

public int indexOf(SDKException e)
Finds the index of the exception.

Parameters:
e - The exception of the index to be found.
Returns:
The index of the exception if it is in the collector or -1 otherwise.

getAssembleExceptions

public SDKException getAssembleExceptions()
Returns the exception assembling all the exceptions in the collector if the size() > 1, or the exception itself if the size() == 1, or null if the collector is empty.


close

public void close()
           throws SDKException
Closes the collector. If there is any exception in the collector, the collector will throw an assembled exception, if size() > 1, or the exception itself , if the size() == 1. It throws nothing if the collector is empty.

Throws:
SDKException