Package com.zinep

Source Code of com.zinep.Main

package com.zinep;

import com.zinep.script.Reader;
import com.zinep.utils.TimeManager;
import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
*
* @author tomas
*/
public class Main {

    public static void main(String[] args) {
        List<String> lineas = new ArrayList<String>();

        InputStream in = null;

        if (args.length < 2) {
            in = Reader.class.getResourceAsStream("/com/zinep/recursos/sim1.txt");
        } else {
            TimeManager.MAXIMO = Integer.parseInt(args[0]);
            try {
                in = new FileInputStream(args[1]);
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
                System.exit(1);
            }
        }

        BufferedReader br = new BufferedReader(new InputStreamReader(in));

        try {
            String strLine;
            while ((strLine = br.readLine()) != null) {
                lineas.add(strLine);
            }
            br.close();
        } catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
        }

        Reader reader = new Reader(lineas);
        reader.procesar();
    }
}
TOP

Related Classes of com.zinep.Main

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.