private boolean parseLine(String nextLine, int line){
		if(nextLine.length()==0 || nextLine.toCharArray()[0] == COMMENT)
			return false;
		if(nextLine.toCharArray()[0]==SIZE_MAP){
			System.out.println("Map:");
			try{
				String[] size_map = nextLine.split(" ");
				size_map = size_map[1].split("x");
				x = Integer.parseInt(size_map[0]);
				System.out.println("SIZEX = " + x);
				y = Integer.parseInt(size_map[1]);
				System.out.println("SIZEY = " + y);
			}
			catch(NumberFormatException except){
				System.err.println("Bad size");
				System.exit(1);
			}
			return false;
		}	
		int xi, yi, xf, yf, way;
		String[] thisLine = nextLine.split("/");
		String[] initial = thisLine[0].split(",");
		String[] destination = thisLine[1].split(",");
		
		try {
			xi = Integer.parseInt(initial[0]);
			System.out.println("xi = "  + xi);
			yi = Integer.parseInt(initial[1]);
			System.out.println("yi = " + yi);
			xf = Integer.parseInt(destination[0]);
			System.out.println("xf = " + xf);
			yf = Integer.parseInt(destination[1]);
			System.out.println("yf = " + yf);
			way = Integer.parseInt(thisLine[2]);
			System.out.println("way = " + way);
			if (way != 0 && way != 1)
				throw new NumberFormatException();
		} catch (NumberFormatException ex) {
				System.out.println("Invalid road at line " + line + ".");
		}
		return true;
		
	}