jparfor
Class IndexedResult<R>

java.lang.Object
  extended by jparfor.IndexedResult<R>
Type Parameters:
R - Type of result the object will contain.
All Implemented Interfaces:
java.lang.Comparable<IndexedResult<R>>

public class IndexedResult<R>
extends java.lang.Object
implements java.lang.Comparable<IndexedResult<R>>

Class used by the MultiThreader. Class used to index the results to return them in the same order that they were indexed.


Constructor Summary
IndexedResult(int index, R result)
          Create the object with the given index and result.
 
Method Summary
 int compareTo(IndexedResult<R> o)
           
 int getIndex()
          Return the index.
 R getResult()
          Return the result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedResult

public IndexedResult(int index,
                     R result)
Create the object with the given index and result.

Parameters:
index - index of the result.
result - result to be returned.
Method Detail

getIndex

public int getIndex()
Return the index.

Returns:
the index.

getResult

public R getResult()
Return the result.

Returns:
the result.

compareTo

public int compareTo(IndexedResult<R> o)
Specified by:
compareTo in interface java.lang.Comparable<IndexedResult<R>>