Package uk.ac.starlink.ttools.cone
Class ConeMatcher.ConeWorker
- java.lang.Object
-
- uk.ac.starlink.ttools.cone.ConeMatcher.ConeWorker
-
- All Implemented Interfaces:
java.lang.Runnable
,TableProducer
- Enclosing class:
- ConeMatcher
public static class ConeMatcher.ConeWorker extends java.lang.Object implements java.lang.Runnable, TableProducer
Object which produces the result table. It performs the individual cone searches and writes the results down a pipe from which it will be read asynchronously for output.To use an instance of this class, it is necessary to call its
run
method in a separate thread. ThegetTable
method may be called before therun
method has completed (or even started), and will return a table whose rows may be streamed.The run method checks for interruptions, so interrupting the thread in which it runs will cause it to stop consuming resources.
This code was originally written for J2SE1.4. There may be less baroque ways of achieving the same effect using the J2SE5 java.util.concurrent classes (
BlockingQueue
).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description uk.ac.starlink.table.StarTable
getTable()
Returns the result table.void
run()
Does the work of feeding the rows to the result table.
-
-
-
Method Detail
-
getTable
public uk.ac.starlink.table.StarTable getTable() throws java.io.IOException
Returns the result table. It will block untilrun
has at least started, but not necessarily until it has completed.- Specified by:
getTable
in interfaceTableProducer
- Returns:
- result table
- Throws:
java.io.IOException
-
run
public void run()
Does the work of feeding the rows to the result table. This method checks regularly for interruptions and will stop running if the thread is interrupted, causing a read error at the other end of the pipe.- Specified by:
run
in interfacejava.lang.Runnable
-
-