org.annotation.wordfreak.io
Interface AnnotatedFileFormat

All Superinterfaces:
FileFormat, Plugin
All Known Implementing Classes:
AbstractAnnotatedFileFormat

public interface AnnotatedFileFormat
extends FileFormat

This defines the interface for implementing new annotated file formats.


Method Summary
 java.io.File getAnnotatedFile(java.lang.String sourceFileName)
          Computes the expected annotation file name for this format from the specified source file name.
 void getNextChunk(AnnotationFile af)
          Indicates that a subsequent portion of the specified file should be read into memory.
 void getPrevChunk(AnnotationFile af)
          Indicates that a previous portion of the specified file should be read into memory.
 void getSettings()
          Used to prompt user for file format settings.
 java.io.File getSourceFile(java.lang.String annotatedFileName)
          Computes the expected source file name for this format from the specified annotated file name.
 SourceFileFormat getSourceFileFormat()
          Returns the file format for the source used with this annotation file format.
 boolean hasNextChunk(AnnotationFile af)
          Returns true if the specified annotation file has only been partially loaded and a subsequent portion remains can be loaded.
 boolean hasPrevChunk(AnnotationFile af)
          Returns true if the specified annotation file has only been partially loaded and a prior portion remains can be loaded.
 AnnotationFile read(java.lang.String source, java.lang.String ann, java.lang.String encoding)
          Reads an annotated file specified by ann and returns an AnnotationFile object representing its contents.
 void write(AnnotationFile af, java.io.Writer out)
          Writes the contents of the AnnotationFile to the Writer specified by out.
 
Methods inherited from interface org.annotation.wordfreak.io.FileFormat
addProgressListener, getExtension, getFileFilter, getFormatName, getIcon, handlesFile, removeProgressListener
 

Method Detail

read

public AnnotationFile read(java.lang.String source,
                           java.lang.String ann,
                           java.lang.String encoding)
                    throws java.io.IOException
Reads an annotated file specified by ann and returns an AnnotationFile object representing its contents.

Parameters:
source - the source file for the annotated file. This parameter may not be required for non-statndoff annotation.
ann - the name of the annotated file.
encoding - the encoding which should be used to read the files.
Returns:
an AnnotatedFile object representing the contents of the annotated file.
Throws:
java.io.IOException

write

public void write(AnnotationFile af,
                  java.io.Writer out)
           throws java.io.IOException
Writes the contents of the AnnotationFile to the Writer specified by out. Also writes the source, if the source has changed This method should not close the Writer.

Specified by:
write in interface FileFormat
Parameters:
af - the annotation file.
out - the Writer to which the file should be written.
Throws:
java.io.IOException

getSourceFileFormat

public SourceFileFormat getSourceFileFormat()
Returns the file format for the source used with this annotation file format. If no source file format exist then null is returned.

Returns:
a file format object or null.

getSourceFile

public java.io.File getSourceFile(java.lang.String annotatedFileName)
Computes the expected source file name for this format from the specified annotated file name.

Parameters:
annotatedFileName - The name of the annotated file.
Returns:
The name of the source file for the specified file format or null if no source file name can be determined.

getAnnotatedFile

public java.io.File getAnnotatedFile(java.lang.String sourceFileName)
Computes the expected annotation file name for this format from the specified source file name.

Parameters:
sourceFileName - The name of the source file.
Returns:
The name of the annotated file for the specified file format or null if no annotated file name can be determined.

getSettings

public void getSettings()
Used to prompt user for file format settings.


hasNextChunk

public boolean hasNextChunk(AnnotationFile af)
Returns true if the specified annotation file has only been partially loaded and a subsequent portion remains can be loaded.

Parameters:
af - The annoation file to be loaded.
Returns:
True is if the specified annotation file has only been partially loaded and a subsequent portion can be loaded, false otherwise.

hasPrevChunk

public boolean hasPrevChunk(AnnotationFile af)
Returns true if the specified annotation file has only been partially loaded and a prior portion remains can be loaded.

Parameters:
af - The annoation file to be loaded.
Returns:
True is if the specified annotation file has only been partially loaded and a prior portion can be loaded, false otherwise.

getNextChunk

public void getNextChunk(AnnotationFile af)
Indicates that a subsequent portion of the specified file should be read into memory.

Parameters:
af - The annotation file to be appended.

getPrevChunk

public void getPrevChunk(AnnotationFile af)
Indicates that a previous portion of the specified file should be read into memory.

Parameters:
af - The annotation file to be prepended.


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.