Package ManejoArchivos

Source Code of ManejoArchivos.ArchivoProfesor

/*
* ArchivoProfesor.java
*
* Created on 12 de noviembre de 2007, 09:11 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package ManejoArchivos;

import GeneracionHorarios.Profesor;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;

/**
*
* @author Fernando
*/
public class ArchivoProfesor {
   
    private BufferedReader lector;
   
    public ArchivoProfesor(String ruta) throws FileNotFoundException {
        lector = new BufferedReader(new FileReader(ruta));
    }

    public Profesor leer() throws IOException, SQLException {
        String lineaProfesor = lector.readLine();
        if (lineaProfesor==null)
            throw new IOException();
        String [] datosProfesor = lineaProfesor.split(",");
        return new Profesor (-1,datosProfesor[0],datosProfesor[1]);
    }
   
    public void finLectura(){
        try {
            lector.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
   
}
TOP

Related Classes of ManejoArchivos.ArchivoProfesor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.