View Javadoc

1   /*
2    * $Id: StarTableWriter.java,v 1.2 2004/11/27 13:20:02 pah Exp $
3    * 
4    * Created on 11-Nov-2004 by Paul Harrison (pah@jb.man.ac.uk)
5    * Copyright 2004 AstroGrid. All rights reserved.
6    *
7    * This software is published under the terms of the AstroGrid 
8    * Software License version 1.2, a copy of which has been included 
9    * with this distribution in the LICENSE.txt file.  
10   *
11   */ 
12  
13  package org.astrogrid.applications.apps.tables;
14  
15  import java.io.IOException;
16  
17  import uk.ac.starlink.table.StarTable;
18  
19  /***
20   * @author Paul Harrison (pah@jb.man.ac.uk) 11-Nov-2004
21   * @version $Name:  $
22   * @since iteration6
23   */
24  public interface StarTableWriter {
25     /***
26      * Writes a <tt>StarTable</tt> object to a given location.
27      * If possible, a location of "-" should be taken as a request to
28      * write to standard output.
29      *
30      * @param  startab  the table to write
31      * @param  location  the destination of the written object 
32      *         (probably, but not necessarily, a filename)
33      */
34     void writeStarTable( StarTable startab, StarTableWriterLocation location )
35             throws IOException;
36  
37     /***
38      * Indicates whether the destination is of a familiar form for this
39      * kind of writer.  This may be used to guess what kind of format
40      * a table should be written in.  Implementations should return
41      * <tt>true</tt> for values of <tt>location</tt> which look like
42      * the normal form for their output format, for instance one with
43      * the usual file extension.
44      *
45      * @param  location  the location name (probably filename)
46      * @return <tt>true</tt> iff it looks like a file this writer would
47      *         normally write
48      */
49     boolean looksLikeFile( StarTableWriterLocation location );
50  
51     /***
52      * Gives the name of the format which is written by this writer.
53      * Matching against this string may be used by callers to identify
54      * or select this writer from a list.
55      *
56      * @param   a short string identifying the output format of this writer
57      */
58     String getFormatName();
59  
60  }