View Javadoc

1   /*
2    * $Id: TableWriter.java,v 1.1 2005/03/21 18:45:55 mch 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     /*** Sets all the column details  */
26     public void startTable(ColumnInfo[] colInfo) throws IOException;
27  
28     /*** Writes the given array of values out */
29     public void writeRow(Object[] colValues) throws IOException;
30  
31     /*** Ends a table (eg closes tags)  */
32     public void endTable() throws IOException;
33     
34     /*** Close the writer */
35     public void close() throws IOException;
36     
37     /*** If the writer needs to stop before normal completion, call this.  It will,
38      * if appropriate, write some message to indicate that the table is incomplete */
39     public void abort() throws IOException;
40     
41     /*** Returns the mime type that this writer produces */
42     public String getMimeType();
43  }
44  
45