uk.ac.umist.co.brailletrans.utils
Class MakeLegacy

java.lang.Object
  |
  +--uk.ac.umist.co.brailletrans.utils.Maker
        |
        +--uk.ac.umist.co.brailletrans.utils.MakeLegacy

public class MakeLegacy
extends uk.ac.umist.co.brailletrans.utils.Maker

Constructs a legacy language rules table file in machine format from text format.


Field Summary
static int DISK_ERROR
          Error code for a failure to complete a program caused by a I/O fault.
static int LANGUAGE_ERROR
          Error code for a failure using a Language.
static int SUCCESS
          Error code for successful completion of a Maker program.
static char TABLE_DELIMITER
          The ASCII character indicating the end of the translation rules.
 
Constructor Summary
MakeLegacy()
           
 
Method Summary
static void main(java.lang.String[] args)
          Command-line access to conversion process.
static void make(java.lang.String inputFilename, java.lang.String outputFilename)
          Performs actual conversion of CON files to DAT files.
static int skipComments(java.io.BufferedInputStream fileIn)
          Skips over comment lines in the language files.
static java.lang.String skipComments(java.io.BufferedReader fileIn)
          Skips over comment lines in the language files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
Error code for successful completion of a Maker program.

DISK_ERROR

public static final int DISK_ERROR
Error code for a failure to complete a program caused by a I/O fault.

LANGUAGE_ERROR

public static final int LANGUAGE_ERROR
Error code for a failure using a Language.

TABLE_DELIMITER

public static final char TABLE_DELIMITER
The ASCII character indicating the end of the translation rules.
Constructor Detail

MakeLegacy

public MakeLegacy()
Method Detail

main

public static void main(java.lang.String[] args)
Command-line access to conversion process.
Parameters:
args - The array of Strings passed as command-line arguments. The arguments are:
  • input filename - full path and name of .con file to convert.
  • output filename - full path and name of .dat file produced.

make

public static void make(java.lang.String inputFilename,
                        java.lang.String outputFilename)
Performs actual conversion of CON files to DAT files.
Parameters:
inputFilename - Full path and name of CON file to process.
outputFilename - Full path and name of DAT file to produce.

skipComments

public static int skipComments(java.io.BufferedInputStream fileIn)
Skips over comment lines in the language files. The human-readable files can have comment lines, indicated by the ':' colon character, or the COMMENT constant in MakeLanguage256. This should return first non-comment character of the first non-comment line as an int.

To be explicit: the method halts only when one of the following is met:

  1. A carriage return is followed by a non-comment non-linefeed character or
  2. A linefeed followed by a non-comment non-carriage return character.
In both cases, the ASCII/Unicode characters for CR, LF are used. This should work for Apple Macintosh, Windows and Unix systems.
Parameters:
fileIn - BufferedInputStream to the file being read from.
Returns:
readBuffer[1] An int, the first character of the next non-comment line.

skipComments

public static java.lang.String skipComments(java.io.BufferedReader fileIn)
Skips over comment lines in the language files. The human-readable files can have comment lines, indicated by the ':' colon character, or the COMMENT constant in MakeLanguage256. This should return first non-comment character of the first non-comment line as an int.
Parameters:
fileIn - BufferedInputStream for the file being read.
Returns:
toReturn String containing the first non-comment line.