KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ziclix > python > sql > pipe > Sink


1 /*
2  * Jython Database Specification API 2.0
3  *
4  * $Id: Sink.java,v 1.2 2005/02/23 04:26:19 bzimmer Exp $
5  *
6  * Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
7  *
8  */

9 package com.ziclix.python.sql.pipe;
10
11 import org.python.core.PyObject;
12
13 /**
14  * A Sink acts as a data consumer. The Pipe is responsible for pushing data
15  * to the Sink as generated by the Source.
16  *
17  * @author brian zimmer
18  * @version $Revision: 1.2 $
19  */

20 public interface Sink {
21
22     /**
23      * Invoked at the start of the data pipelining session.
24      */

25     public void start();
26
27     /**
28      * Invoked for each row of data. In general, the first row of data will
29      * consist of header information in the format:<br/>
30      * &nbsp;&nbsp;[(colName, colType), ...]
31      * and in the format:<br/>
32      * &nbsp;&nbsp;(colData, colData, ...)
33      * for all other data.
34      */

35     public void row(PyObject row);
36
37     /**
38      * Invoked at the end of the data pipelining session. This is useful for
39      * flushing any buffers or handling any cleanup. This method is guaranteed
40      * to be called.
41      */

42     public void end();
43 }
44
Popular Tags