|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--com.ibm.tspaces.examples.mergesort.SortThread
This class implements a merge sort using a TupleSpace to hold the values to be sorted and intermediate results.
MergeSort,
Tuple,
Field,
TupleSpace| Field Summary | |
int |
t1cnt
Count of Tuple reads. |
int |
t2cnt
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
| Constructor Summary | |
SortThread(TupleSpace ts,
int i)
Create a SortThread. |
|
| Method Summary | |
static void |
main(java.lang.String[] argv)
The starting point of execution for the sort thread |
DataTuple |
mergeTuples(DataTuple t1,
DataTuple t2)
Extract the two Vectors of integers from some data Tuples and merge sort them to produce a data Tuple with the values sorted. |
VectorWithEquals |
mergeVectors(java.util.Vector v1,
java.util.Vector v2)
Merge sort two vectors of sorted integers. |
void |
run()
The starting point of execution. |
| Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public int t1cnt
public int t2cnt
| Constructor Detail |
public SortThread(TupleSpace ts,
int i)
ts - the TupleSpace where the values to be sorted are stored.i - the index of the thread.TupleSpace| Method Detail |
public void run()
public DataTuple mergeTuples(DataTuple t1,
DataTuple t2)
throws TupleSpaceException
t1 - A Tuple with the second field a Vector of sorted integers.t2 - A Tuple with the second field a Vector of sorted integers.
public VectorWithEquals mergeVectors(java.util.Vector v1,
java.util.Vector v2)
v1 - A Vector of integers in increasing sorted order.v2 - A Vector of integers in increasing sorted order.public static void main(java.lang.String[] argv)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||