All pastes #838540 Raw Edit

Terka

public java v1 · immutable
#838540 ·published 2007-12-30 13:44 UTC
rendered paste body
    public static Matice nactiZeSouboru(String path) {    	boolean nacteno = false;    	Matice soustava = null;    	    		try {    			FileReader fileReader = new FileReader(path);    	        LineNumberReader reader = new LineNumberReader(fileReader);    	        int n = reader.getLineNumber();			//zjisti pocet radku    	        soustava = new Matice(n);		//vytvori matici    	        String str;								//retezec, kterej nacitam    	        String[] tmp = new String[n+1];			//jeden nactenej radek    	        int curRow=0;    	            	            	        while ((str = reader.readLine()) != null) {    	        	tmp = str.split(" ");    	            curRow++;    	            soustava.narviDoMatice(tmp, curRow);		//zapise celej radek do matice    	        }    	        nacteno=true;    	        reader.close();    	    } catch (IOException e) {    	    	System.out.println("Neco se pokakalo.");    	    }    	    	return soustava;    }