Package generic.concurrent

# Class QResult<I,R>

java.lang.Object
generic.concurrent.QResult<I,R>

Type Parameters:
  `I` - the type of the items in the ConcurrentQ.
  `R` - the type of objects returned from processing an item in a ConcurrentQ.

public class QResult<I,R> extends Object
Class for holding the result of processing an Item in a ConcurrentQ.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `QResult(I item, Future<R> future)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Exception`
  `getError()`
  Returns any Exception that was encountered during processing of the item
  `I`
  `getItem()`
  Returns the item that was processed.
  `R`
  `getResult()`
  The result from processing the item.
  `boolean`
  `hasError()`
  Returns true if the item encountered an error while processing the item.
  `boolean`
  `isCancelled()`
  Returns true if the item's processing was cancelled.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### QResult

    public QResult(I item, Future<R> future)

- ## Method Details

  - ### getItem

    public I getItem()
    Returns the item that was processed.
    Returns:
      the item that was processed.

  - ### getResult

    public R getResult() throws Exception
    The result from processing the item. Will be null if the item was cancelled or had an error.
    Returns:
      the result from processing the item or null if it did not complete successfully.
    Throws:
      `Exception` - any exception that was thrown during the processing of the input item

  - ### getError

    public Exception getError()
    Returns any Exception that was encountered during processing of the item
    Returns:
      any Exception that was encountered during processing of the item

  - ### hasError

    public boolean hasError()
    Returns true if the item encountered an error while processing the item.
    Returns:
      true if the item encountered an error while processing the item.

  - ### isCancelled

    public boolean isCancelled()
    Returns true if the item's processing was cancelled.
    Returns:
      true if the item's processing was cancelled.