/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Readers;
import Core.Data;
import Core.Result;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
/**
*
* @author Amir
*/
public class WSSReader extends FileReader{
ObjectInputStream oin;
Data data;
Result result;
/**
* Constructor of WSS reader module
* @param inFile input file to be read
* @throws FileNotFoundException if the selected file deos not exist
* @throws IOException if there is an error reading the file
*/
public WSSReader(File inFile) throws FileNotFoundException, IOException {
oin = new ObjectInputStream(new FileInputStream(inFile));
data = new Data();
result = new Result();
try {
data = (Data) oin.readObject();
} catch (ClassNotFoundException ex) {
throw new IOException("Object Reading Error! Please consult the development team");
}
}
@Override
public Data readData() {
return data;
}
/**
* Returns the result stored in the file
* @return Result stored in the file
*/
public Result readResult(){
return result;
}
}