vsp.readConfig
Class ReadConfig

java.lang.Object
  extended by vsp.readConfig.ReadConfig
Direct Known Subclasses:
ReadConfigExp, ReadConfigGauss

public abstract class ReadConfig
extends Object

Abstract class for reading config file

Author:
Jan Tichava

Field Summary
private  BufferedReader bufferedReader
          Reader for config file
 
Constructor Summary
ReadConfig(String fileName)
          Creates new reader and opens file
 
Method Summary
protected  void finalize()
          Close file, when disposing object
abstract  Config read()
          Read config file
private  Config readHead(Config config)
          Read head from file
protected  ConfigExp readHead(ConfigExp config)
          Read head from config file for exp.
protected  ConfigGauss readHead(ConfigGauss config)
          Read head from config file for Gauss.
protected  String readLine()
          Reads next line from config file, which is not empty and not a comment
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferedReader

private BufferedReader bufferedReader
Reader for config file

Constructor Detail

ReadConfig

public ReadConfig(String fileName)
           throws FileNotFoundException
Creates new reader and opens file

Parameters:
fileName -
Throws:
FileNotFoundException
Method Detail

readLine

protected String readLine()
                   throws IOException
Reads next line from config file, which is not empty and not a comment

Returns:
Throws:
IOException

readHead

protected ConfigExp readHead(ConfigExp config)
                      throws NumberFormatException,
                             IOException
Read head from config file for exp.

Parameters:
config -
Returns:
Throws:
NumberFormatException
IOException

readHead

protected ConfigGauss readHead(ConfigGauss config)
                        throws NumberFormatException,
                               IOException
Read head from config file for Gauss.

Parameters:
config -
Returns:
Throws:
NumberFormatException
IOException

readHead

private Config readHead(Config config)
                 throws NumberFormatException,
                        IOException
Read head from file

Parameters:
config -
Returns:
Throws:
NumberFormatException
IOException

read

public abstract Config read()
                     throws NumberFormatException,
                            IOException
Read config file

Returns:
Throws:
NumberFormatException
IOException

finalize

protected void finalize()
                 throws Throwable
Close file, when disposing object

Overrides:
finalize in class Object
Throws:
Throwable