View Javadoc

1   /*
2    * $Id: TableWriter.java,v 1.2 2005/05/27 16:21:02 clq2 Exp $
3    *
4    * (C) Copyright Astrogrid...
5    */
6   
7   package org.astrogrid.tableserver.out;
8   
9   import org.astrogrid.tableserver.metadata.*;
10  
11  import java.io.IOException;
12  
13  /***
14   * Defines the methods a table writer must implement...
15   *
16   * @author M Hill
17   */
18  
19  public interface TableWriter {
20     
21     /*** Sets the details of a column. Fails if col is bigger than the existing internal
22     * array; use setColumnMetadata(array) to set the size */
23  //   public void setColumnMetadata(int col, ColumnInfo columnInfo) throws IOException;
24  
25     /*** Starts the writer */
26     public void open() throws IOException;
27     
28     /*** Sets all the column details  */
29     public void startTable(ColumnInfo[] colInfo) throws IOException;
30  
31     /*** Writes the given array of values out */
32     public void writeRow(Object[] colValues) throws IOException;
33  
34     /*** Ends a table (eg closes tags)  */
35     public void endTable() throws IOException;
36     
37     /*** Close the writer */
38     public void close() throws IOException;
39     
40     /*** If the writer needs to stop before normal completion, call this.  It will,
41      * if appropriate, write some message to indicate that the table is incomplete */
42     public void abort() throws IOException;
43     
44     /*** Returns the mime type that this writer produces */
45     public String getMimeType();
46  }
47  
48